Re: drivers/extcon/extcon-intel-cht-wc.c:153:3: warning: this statement may fall through

From: Andy Shevchenko
Date: Wed Nov 22 2023 - 13:33:51 EST


On Wed, Nov 22, 2023 at 07:27:14AM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: c2d5304e6c648ebcf653bace7e51e0e6742e46c8
> commit: de85d79f4aab67fe0537dd6e2c5d545b88239cc4 mfd: Add Cherry Trail Whiskey Cove PMIC driver
> date: 6 years ago
> config: i386-randconfig-002-20231120 (https://download.01.org/0day-ci/archive/20231122/202311220741.oIvJcjV4-lkp@xxxxxxxxx/config)
> compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231122/202311220741.oIvJcjV4-lkp@xxxxxxxxx/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202311220741.oIvJcjV4-lkp@xxxxxxxxx/

...

> db0f3baaa38bb5 Hans de Goede 2017-03-23 151 switch (usbsrc) {
> db0f3baaa38bb5 Hans de Goede 2017-03-23 152 default:
> db0f3baaa38bb5 Hans de Goede 2017-03-23 @153 dev_warn(ext->dev,
> db0f3baaa38bb5 Hans de Goede 2017-03-23 154 "Unhandled charger type %d, defaulting to SDP\n",
> db0f3baaa38bb5 Hans de Goede 2017-03-23 155 ret);

> db0f3baaa38bb5 Hans de Goede 2017-03-23 156 /* Fall through, treat as SDP */

Replacing this comment by a fallthrough annotation should fix this (and comment
itself is redundant as long as properly annotated).

> db0f3baaa38bb5 Hans de Goede 2017-03-23 157 case CHT_WC_USBSRC_TYPE_SDP:
> db0f3baaa38bb5 Hans de Goede 2017-03-23 158 case CHT_WC_USBSRC_TYPE_FLOAT_DP_DN:
> db0f3baaa38bb5 Hans de Goede 2017-03-23 159 case CHT_WC_USBSRC_TYPE_OTHER:
> db0f3baaa38bb5 Hans de Goede 2017-03-23 160 return EXTCON_CHG_USB_SDP;
> db0f3baaa38bb5 Hans de Goede 2017-03-23 161 case CHT_WC_USBSRC_TYPE_CDP:
> db0f3baaa38bb5 Hans de Goede 2017-03-23 162 return EXTCON_CHG_USB_CDP;
> db0f3baaa38bb5 Hans de Goede 2017-03-23 163 case CHT_WC_USBSRC_TYPE_DCP:
> db0f3baaa38bb5 Hans de Goede 2017-03-23 164 case CHT_WC_USBSRC_TYPE_DCP_EXTPHY:
> db0f3baaa38bb5 Hans de Goede 2017-03-23 165 case CHT_WC_USBSRC_TYPE_MHL: /* MHL2+ delivers upto 2A, treat as DCP */
> db0f3baaa38bb5 Hans de Goede 2017-03-23 166 return EXTCON_CHG_USB_DCP;
> db0f3baaa38bb5 Hans de Goede 2017-03-23 167 case CHT_WC_USBSRC_TYPE_ACA:
> db0f3baaa38bb5 Hans de Goede 2017-03-23 168 return EXTCON_CHG_USB_ACA;
> db0f3baaa38bb5 Hans de Goede 2017-03-23 169 }

--
With Best Regards,
Andy Shevchenko