extcon: cht-wc: Return from default case to avoid warnings
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 27 Aug 2018 15:35:53 +0000 (18:35 +0300)
committerChanwoo Choi <cw00.choi@samsung.com>
Tue, 28 Aug 2018 02:21:15 +0000 (11:21 +0900)
When we have first case to fall through it's not enough to put
single comment there to satisfy compiler. Instead of doing that,
return fall back value directly from default case.

This to avoid following warnings:

drivers/extcon/extcon-intel-cht-wc.c: In function ‘cht_wc_extcon_get_charger’:
include/linux/device.h:1420:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
  _dev_warn(dev, dev_fmt(fmt), ##__VA_ARGS__)
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/extcon/extcon-intel-cht-wc.c:148:3: note: in expansion of macro ‘dev_warn’
   dev_warn(ext->dev,
   ^~~~~~~~
drivers/extcon/extcon-intel-cht-wc.c:152:2: note: here
  case CHT_WC_USBSRC_TYPE_SDP:
  ^~~~

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
drivers/extcon/extcon-intel-cht-wc.c

index 5e1dd27..bdb6787 100644 (file)
@@ -156,7 +156,7 @@ static int cht_wc_extcon_get_charger(struct cht_wc_extcon_data *ext,
                dev_warn(ext->dev,
                        "Unhandled charger type %d, defaulting to SDP\n",
                         ret);
-               /* Fall through, treat as SDP */
+               return EXTCON_CHG_USB_SDP;
        case CHT_WC_USBSRC_TYPE_SDP:
        case CHT_WC_USBSRC_TYPE_FLOAT_DP_DN:
        case CHT_WC_USBSRC_TYPE_OTHER: