Skip to contentSkip to conversation

Input: elantech - mark expected switch fall-through

PATCH In review Gustavo A. R. Silva 2 participants 3 messages Jul 24, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: elantech - mark expected switch fall-through

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.

---
 drivers/input/mouse/elantech.c | 1 +
 1 file changed, 1 insertion(+)
drivers/input/mouse/elantech.c +1 -0
index 73544776a9ed..04fe43440a3c 100644
@@ -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);
Signature · 1 line
2.22.0
maintainer
#1 lore raw

Hi Gustavo,

Quoted 5 lines · Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

This patch fixes the following warning:

Quoted 7 lines

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.

Signature · 1 line
Dmitry
#2 lore raw
Quoted 4 lines

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

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

Thanks
--
Gustavo