* [PATCH] platform/x86: thinkpad_acpi: Mark expected switch fall-throughs
@ 2019-04-24 18:15 Gustavo A. R. Silva
2019-04-24 19:05 ` Kees Cook
0 siblings, 1 reply; 5+ messages in thread
From: Gustavo A. R. Silva @ 2019-04-24 18:15 UTC (permalink / raw)
To: Henrique de Moraes Holschuh, Darren Hart, Andy Shevchenko
Cc: ibm-acpi-devel, platform-driver-x86, linux-kernel,
Gustavo A. R. Silva, Kees Cook
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>
---
drivers/platform/x86/thinkpad_acpi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 57d9ae9d8e56..826e9a276818 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -4212,7 +4212,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
known_ev = true;
break;
}
- /* fallthrough to default */
+ /* fallthrough - to default */
default:
known_ev = false;
}
@@ -6317,8 +6317,8 @@ static int thermal_get_sensor(int idx, s32 *value)
t = TP_EC_THERMAL_TMP8;
idx -= 8;
}
- /* fallthrough */
#endif
+ /* fallthrough */
case TPACPI_THERMAL_TPEC_8:
if (idx <= 7) {
if (!acpi_ec_read(t + idx, &tmp))
--
2.21.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] platform/x86: thinkpad_acpi: Mark expected switch fall-throughs
2019-04-24 18:15 [PATCH] platform/x86: thinkpad_acpi: Mark expected switch fall-throughs Gustavo A. R. Silva
@ 2019-04-24 19:05 ` Kees Cook
2019-04-25 0:55 ` ibm-acpi
0 siblings, 1 reply; 5+ messages in thread
From: Kees Cook @ 2019-04-24 19:05 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Henrique de Moraes Holschuh, Darren Hart, Andy Shevchenko,
ibm-acpi-devel, Platform Driver, LKML
On Wed, Apr 24, 2019 at 11:15 AM Gustavo A. R. Silva
<gustavo@embeddedor.com> wrote:
>
> 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>
-Kees
> ---
> drivers/platform/x86/thinkpad_acpi.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index 57d9ae9d8e56..826e9a276818 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -4212,7 +4212,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
> known_ev = true;
> break;
> }
> - /* fallthrough to default */
> + /* fallthrough - to default */
> default:
> known_ev = false;
> }
> @@ -6317,8 +6317,8 @@ static int thermal_get_sensor(int idx, s32 *value)
> t = TP_EC_THERMAL_TMP8;
> idx -= 8;
> }
> - /* fallthrough */
> #endif
> + /* fallthrough */
> case TPACPI_THERMAL_TPEC_8:
> if (idx <= 7) {
> if (!acpi_ec_read(t + idx, &tmp))
> --
> 2.21.0
>
--
Kees Cook
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] platform/x86: thinkpad_acpi: Mark expected switch fall-throughs
2019-04-24 19:05 ` Kees Cook
@ 2019-04-25 0:55 ` ibm-acpi
2019-05-01 20:43 ` Gustavo A. R. Silva
0 siblings, 1 reply; 5+ messages in thread
From: ibm-acpi @ 2019-04-25 0:55 UTC (permalink / raw)
To: Kees Cook, Gustavo A. R. Silva
Cc: Darren Hart, Andy Shevchenko, Thinkpad-acpi devel ML,
Platform Driver, LKML
On Wed, Apr 24, 2019, at 16:05, Kees Cook wrote:
> On Wed, Apr 24, 2019 at 11:15 AM Gustavo A. R. Silva
> <gustavo@embeddedor.com> wrote:
> >
> > 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>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] platform/x86: thinkpad_acpi: Mark expected switch fall-throughs
2019-04-25 0:55 ` ibm-acpi
@ 2019-05-01 20:43 ` Gustavo A. R. Silva
2019-05-06 12:22 ` Andy Shevchenko
0 siblings, 1 reply; 5+ messages in thread
From: Gustavo A. R. Silva @ 2019-05-01 20:43 UTC (permalink / raw)
To: ibm-acpi, Kees Cook
Cc: Darren Hart, Andy Shevchenko, Thinkpad-acpi devel ML,
Platform Driver, LKML
On 4/24/19 7:55 PM, ibm-acpi@hmh.eng.br wrote:
> On Wed, Apr 24, 2019, at 16:05, Kees Cook wrote:
>> On Wed, Apr 24, 2019 at 11:15 AM Gustavo A. R. Silva
>> <gustavo@embeddedor.com> wrote:
>>>
>>> In preparation to enabling -Wimplicit-fallthrough, mark switch
>>> cases where we are expecting to fall through.
>>>
>>> This patch fixes the following warnings:
>>>
[..]
>>>
>>> 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>
>
Thank you both, Kees and Henrique.
Friendly ping:
Who can take this?
Thanks
--
Gustavo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] platform/x86: thinkpad_acpi: Mark expected switch fall-throughs
2019-05-01 20:43 ` Gustavo A. R. Silva
@ 2019-05-06 12:22 ` Andy Shevchenko
0 siblings, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2019-05-06 12:22 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Henrique de Moraes Holschuh, Kees Cook, Darren Hart,
Andy Shevchenko, Thinkpad-acpi devel ML, Platform Driver, LKML
On Wed, May 1, 2019 at 11:44 PM Gustavo A. R. Silva
<gustavo@embeddedor.com> wrote:
>
>
>
> On 4/24/19 7:55 PM, ibm-acpi@hmh.eng.br wrote:
> > On Wed, Apr 24, 2019, at 16:05, Kees Cook wrote:
> >> On Wed, Apr 24, 2019 at 11:15 AM Gustavo A. R. Silva
> >> <gustavo@embeddedor.com> wrote:
> >>>
> >>> In preparation to enabling -Wimplicit-fallthrough, mark switch
> >>> cases where we are expecting to fall through.
> >>>
> >>> This patch fixes the following warnings:
> >>>
>
> [..]
>
> >>>
> >>> 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>
> >
>
> Thank you both, Kees and Henrique.
>
> Friendly ping:
>
> Who can take this?
Pushed to my review and testing queue, thanks!
>
> Thanks
> --
> Gustavo
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-05-06 12:22 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-24 18:15 [PATCH] platform/x86: thinkpad_acpi: Mark expected switch fall-throughs Gustavo A. R. Silva
2019-04-24 19:05 ` Kees Cook
2019-04-25 0:55 ` ibm-acpi
2019-05-01 20:43 ` Gustavo A. R. Silva
2019-05-06 12:22 ` Andy Shevchenko
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.