]> git.baikalelectronics.ru Git - kernel.git/commit
platform/x86: thinkpad_acpi: Mark expected switch fall-throughs
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Wed, 24 Apr 2019 18:15:44 +0000 (13:15 -0500)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 8 May 2019 21:33:02 +0000 (00:33 +0300)
commitc77c357722285167de3377ef9d35eb9fbf993586
tree5acd7527e3570c48fdc6d49e58788b113c639b39
parent1cbd7a64959d33e7a2a1fa2bf36a62b350a9fcbd
platform/x86: thinkpad_acpi: Mark expected switch fall-throughs

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

This patch fixes the following warnings:

drivers/platform/x86/thinkpad_acpi.c: In function ‘thermal_get_sensor’:
drivers/platform/x86/thinkpad_acpi.c:6316:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
   if (idx >= 8 && idx <= 15) {
      ^
drivers/platform/x86/thinkpad_acpi.c:6322:2: note: here
  case TPACPI_THERMAL_TPEC_8:
  ^~~~
drivers/platform/x86/thinkpad_acpi.c: In function ‘hotkey_notify’:
drivers/platform/x86/thinkpad_acpi.c:4208:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
    if (tp_features.hotkey_wlsw &&
       ^
drivers/platform/x86/thinkpad_acpi.c:4216:3: note: here
   default:
   ^~~~~~~

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

Notice that, in this particular case, the code comments are modified
in accordance with what GCC is expecting to find.

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

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/thinkpad_acpi.c