diff mbox series

Input: elantech - mark expected switch fall-through

Message ID 20190724175202.GA9583@embeddedor (mailing list archive)
State Mainlined
Commit f3b5720cabafe90b8b7cffbc7b8fec1c17d4ff4b
Headers show
Series Input: elantech - mark expected switch fall-through | expand

Commit Message

Gustavo A. R. Silva July 24, 2019, 5:52 p.m. UTC
In preparation to enabling -Wimplicit-fallthrough, mark switch
cases where we are expecting to fall through.

This patch fixes the following warning:

drivers/input/mouse/elantech.c: In function 'elantech_use_host_notify':
drivers/input/mouse/elantech.c:1843:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
   if (dmi_get_bios_year() >= 2018)
      ^
drivers/input/mouse/elantech.c:1845:2: note: here
  default:
  ^~~~~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

This patch is part of the ongoing efforts to enable
-Wimplicit-fallthrough.

Notice that -Wimplicit-fallthrough will be globally
enabled in v5.3.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/input/mouse/elantech.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Dmitry Torokhov July 24, 2019, 7:25 p.m. UTC | #1
Hi Gustavo,

On Wed, Jul 24, 2019 at 12:52:02PM -0500, Gustavo A. R. Silva wrote:
> In preparation to enabling -Wimplicit-fallthrough, mark switch
> cases where we are expecting to fall through.
> 
> This patch fixes the following warning:
> 
> drivers/input/mouse/elantech.c: In function 'elantech_use_host_notify':
> drivers/input/mouse/elantech.c:1843:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
>    if (dmi_get_bios_year() >= 2018)
>       ^
> drivers/input/mouse/elantech.c:1845:2: note: here
>   default:
>   ^~~~~~~

Thank you for the patch but I already pushed out similar patch.

Thanks.
Gustavo A. R. Silva July 24, 2019, 7:29 p.m. UTC | #2
> 
> Thank you for the patch but I already pushed out similar patch.
> 

Great. Good to know it's already fixed. :)

Thanks
--
Gustavo
diff mbox series

Patch

diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 73544776a9ed..04fe43440a3c 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -1842,6 +1842,7 @@  static bool elantech_use_host_notify(struct psmouse *psmouse,
 		/* SMbus implementation is stable since 2018 */
 		if (dmi_get_bios_year() >= 2018)
 			return true;
+		/* fall through */
 	default:
 		psmouse_dbg(psmouse,
 			    "Ignoring SMBus bus provider %d\n", info->bus);