* [PATCH] watchdog: machzwd: Mark expected switch fall-through
@ 2019-04-10 18:49 Gustavo A. R. Silva
2019-04-10 20:35 ` Guenter Roeck
0 siblings, 1 reply; 6+ messages in thread
From: Gustavo A. R. Silva @ 2019-04-10 18:49 UTC (permalink / raw)
To: Wim Van Sebroeck, Guenter Roeck
Cc: linux-watchdog, linux-kernel, 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 warnings:
drivers/watchdog/machzwd.c: In function ‘zf_set_timer’:
./arch/x86/include/asm/io.h:355:14: warning: this statement may fall through [-Wimplicit-fallthrough=]
#define outw outw
drivers/watchdog/machzwd.c:80:53: note: in expansion of macro ‘outw’
#define zf_writew(port, data) { outb(port, INDEX); outw(data, DATA_W); }
^~~~
drivers/watchdog/machzwd.c:179:3: note: in expansion of macro ‘zf_writew’
zf_writew(COUNTER_1, new);
^~~~~~~~~
drivers/watchdog/machzwd.c:180:2: note: here
case WD2:
^~~~
Warning level 3 was used: -Wimplicit-fallthrough=3
This patch is part of the ongoing efforts to enable
-Wimplicit-fallthrough.
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/watchdog/machzwd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/watchdog/machzwd.c b/drivers/watchdog/machzwd.c
index 88d823d87a4b..108928dbc754 100644
--- a/drivers/watchdog/machzwd.c
+++ b/drivers/watchdog/machzwd.c
@@ -177,6 +177,7 @@ static inline void zf_set_timer(unsigned short new, unsigned char n)
switch (n) {
case WD1:
zf_writew(COUNTER_1, new);
+ /* fall through */
case WD2:
zf_writeb(COUNTER_2, new > 0xff ? 0xff : new);
default:
--
2.21.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] watchdog: machzwd: Mark expected switch fall-through
2019-04-10 18:49 [PATCH] watchdog: machzwd: Mark expected switch fall-through Gustavo A. R. Silva
@ 2019-04-10 20:35 ` Guenter Roeck
2019-04-10 20:51 ` Gustavo A. R. Silva
0 siblings, 1 reply; 6+ messages in thread
From: Guenter Roeck @ 2019-04-10 20:35 UTC (permalink / raw)
To: Gustavo A. R. Silva; +Cc: Wim Van Sebroeck, linux-watchdog, linux-kernel
On Wed, Apr 10, 2019 at 01:49:05PM -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 warnings:
>
> drivers/watchdog/machzwd.c: In function ‘zf_set_timer’:
> ./arch/x86/include/asm/io.h:355:14: warning: this statement may fall through [-Wimplicit-fallthrough=]
> #define outw outw
> drivers/watchdog/machzwd.c:80:53: note: in expansion of macro ‘outw’
> #define zf_writew(port, data) { outb(port, INDEX); outw(data, DATA_W); }
> ^~~~
> drivers/watchdog/machzwd.c:179:3: note: in expansion of macro ‘zf_writew’
> zf_writew(COUNTER_1, new);
> ^~~~~~~~~
> drivers/watchdog/machzwd.c:180:2: note: here
> case WD2:
> ^~~~
>
> Warning level 3 was used: -Wimplicit-fallthrough=3
>
> This patch is part of the ongoing efforts to enable
> -Wimplicit-fallthrough.
>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/watchdog/machzwd.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/watchdog/machzwd.c b/drivers/watchdog/machzwd.c
> index 88d823d87a4b..108928dbc754 100644
> --- a/drivers/watchdog/machzwd.c
> +++ b/drivers/watchdog/machzwd.c
> @@ -177,6 +177,7 @@ static inline void zf_set_timer(unsigned short new, unsigned char n)
> switch (n) {
> case WD1:
> zf_writew(COUNTER_1, new);
> + /* fall through */
> case WD2:
> zf_writeb(COUNTER_2, new > 0xff ? 0xff : new);
> default:
> --
> 2.21.0
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] watchdog: machzwd: Mark expected switch fall-through
2019-04-10 20:35 ` Guenter Roeck
@ 2019-04-10 20:51 ` Gustavo A. R. Silva
2019-04-24 17:01 ` Gustavo A. R. Silva
0 siblings, 1 reply; 6+ messages in thread
From: Gustavo A. R. Silva @ 2019-04-10 20:51 UTC (permalink / raw)
To: Guenter Roeck; +Cc: Wim Van Sebroeck, linux-watchdog, linux-kernel
On 4/10/19 3:35 PM, Guenter Roeck wrote:
> On Wed, Apr 10, 2019 at 01:49:05PM -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 warnings:
>>
>> drivers/watchdog/machzwd.c: In function ‘zf_set_timer’:
>> ./arch/x86/include/asm/io.h:355:14: warning: this statement may fall through [-Wimplicit-fallthrough=]
>> #define outw outw
>> drivers/watchdog/machzwd.c:80:53: note: in expansion of macro ‘outw’
>> #define zf_writew(port, data) { outb(port, INDEX); outw(data, DATA_W); }
>> ^~~~
>> drivers/watchdog/machzwd.c:179:3: note: in expansion of macro ‘zf_writew’
>> zf_writew(COUNTER_1, new);
>> ^~~~~~~~~
>> drivers/watchdog/machzwd.c:180:2: note: here
>> case WD2:
>> ^~~~
>>
>> Warning level 3 was used: -Wimplicit-fallthrough=3
>>
>> This patch is part of the ongoing efforts to enable
>> -Wimplicit-fallthrough.
>>
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
>
Thank you, Guenter.
--
Gustavo
>> ---
>> drivers/watchdog/machzwd.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/watchdog/machzwd.c b/drivers/watchdog/machzwd.c
>> index 88d823d87a4b..108928dbc754 100644
>> --- a/drivers/watchdog/machzwd.c
>> +++ b/drivers/watchdog/machzwd.c
>> @@ -177,6 +177,7 @@ static inline void zf_set_timer(unsigned short new, unsigned char n)
>> switch (n) {
>> case WD1:
>> zf_writew(COUNTER_1, new);
>> + /* fall through */
>> case WD2:
>> zf_writeb(COUNTER_2, new > 0xff ? 0xff : new);
>> default:
>> --
>> 2.21.0
>>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] watchdog: machzwd: Mark expected switch fall-through
2019-04-10 20:51 ` Gustavo A. R. Silva
@ 2019-04-24 17:01 ` Gustavo A. R. Silva
2019-04-24 17:28 ` Guenter Roeck
0 siblings, 1 reply; 6+ messages in thread
From: Gustavo A. R. Silva @ 2019-04-24 17:01 UTC (permalink / raw)
To: Guenter Roeck; +Cc: Wim Van Sebroeck, linux-watchdog, linux-kernel, Kees Cook
Hi Guenter,
I wonder if you took this in you watchdog-next branch.
Thanks
--
Gustavo
On 4/10/19 3:51 PM, Gustavo A. R. Silva wrote:
>
>
> On 4/10/19 3:35 PM, Guenter Roeck wrote:
>> On Wed, Apr 10, 2019 at 01:49:05PM -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 warnings:
>>>
>>> drivers/watchdog/machzwd.c: In function ‘zf_set_timer’:
>>> ./arch/x86/include/asm/io.h:355:14: warning: this statement may fall through [-Wimplicit-fallthrough=]
>>> #define outw outw
>>> drivers/watchdog/machzwd.c:80:53: note: in expansion of macro ‘outw’
>>> #define zf_writew(port, data) { outb(port, INDEX); outw(data, DATA_W); }
>>> ^~~~
>>> drivers/watchdog/machzwd.c:179:3: note: in expansion of macro ‘zf_writew’
>>> zf_writew(COUNTER_1, new);
>>> ^~~~~~~~~
>>> drivers/watchdog/machzwd.c:180:2: note: here
>>> case WD2:
>>> ^~~~
>>>
>>> Warning level 3 was used: -Wimplicit-fallthrough=3
>>>
>>> This patch is part of the ongoing efforts to enable
>>> -Wimplicit-fallthrough.
>>>
>>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>>
>> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
>>
>
> Thank you, Guenter.
> --
> Gustavo
>
>>> ---
>>> drivers/watchdog/machzwd.c | 1 +
>>> 1 file changed, 1 insertion(+)
>>>
>>> diff --git a/drivers/watchdog/machzwd.c b/drivers/watchdog/machzwd.c
>>> index 88d823d87a4b..108928dbc754 100644
>>> --- a/drivers/watchdog/machzwd.c
>>> +++ b/drivers/watchdog/machzwd.c
>>> @@ -177,6 +177,7 @@ static inline void zf_set_timer(unsigned short new, unsigned char n)
>>> switch (n) {
>>> case WD1:
>>> zf_writew(COUNTER_1, new);
>>> + /* fall through */
>>> case WD2:
>>> zf_writeb(COUNTER_2, new > 0xff ? 0xff : new);
>>> default:
>>> --
>>> 2.21.0
>>>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] watchdog: machzwd: Mark expected switch fall-through
2019-04-24 17:01 ` Gustavo A. R. Silva
@ 2019-04-24 17:28 ` Guenter Roeck
2019-04-24 17:36 ` Gustavo A. R. Silva
0 siblings, 1 reply; 6+ messages in thread
From: Guenter Roeck @ 2019-04-24 17:28 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Wim Van Sebroeck, linux-watchdog, linux-kernel, Kees Cook
On Wed, Apr 24, 2019 at 12:01:03PM -0500, Gustavo A. R. Silva wrote:
> Hi Guenter,
>
> I wonder if you took this in you watchdog-next branch.
>
It is in branch watchdog-next of
git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git
waiting for Wim to pick it up.
Guenter
> Thanks
> --
> Gustavo
>
> On 4/10/19 3:51 PM, Gustavo A. R. Silva wrote:
> >
> >
> > On 4/10/19 3:35 PM, Guenter Roeck wrote:
> >> On Wed, Apr 10, 2019 at 01:49:05PM -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 warnings:
> >>>
> >>> drivers/watchdog/machzwd.c: In function ‘zf_set_timer’:
> >>> ./arch/x86/include/asm/io.h:355:14: warning: this statement may fall through [-Wimplicit-fallthrough=]
> >>> #define outw outw
> >>> drivers/watchdog/machzwd.c:80:53: note: in expansion of macro ‘outw’
> >>> #define zf_writew(port, data) { outb(port, INDEX); outw(data, DATA_W); }
> >>> ^~~~
> >>> drivers/watchdog/machzwd.c:179:3: note: in expansion of macro ‘zf_writew’
> >>> zf_writew(COUNTER_1, new);
> >>> ^~~~~~~~~
> >>> drivers/watchdog/machzwd.c:180:2: note: here
> >>> case WD2:
> >>> ^~~~
> >>>
> >>> Warning level 3 was used: -Wimplicit-fallthrough=3
> >>>
> >>> This patch is part of the ongoing efforts to enable
> >>> -Wimplicit-fallthrough.
> >>>
> >>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> >>
> >> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> >>
> >
> > Thank you, Guenter.
> > --
> > Gustavo
> >
> >>> ---
> >>> drivers/watchdog/machzwd.c | 1 +
> >>> 1 file changed, 1 insertion(+)
> >>>
> >>> diff --git a/drivers/watchdog/machzwd.c b/drivers/watchdog/machzwd.c
> >>> index 88d823d87a4b..108928dbc754 100644
> >>> --- a/drivers/watchdog/machzwd.c
> >>> +++ b/drivers/watchdog/machzwd.c
> >>> @@ -177,6 +177,7 @@ static inline void zf_set_timer(unsigned short new, unsigned char n)
> >>> switch (n) {
> >>> case WD1:
> >>> zf_writew(COUNTER_1, new);
> >>> + /* fall through */
> >>> case WD2:
> >>> zf_writeb(COUNTER_2, new > 0xff ? 0xff : new);
> >>> default:
> >>> --
> >>> 2.21.0
> >>>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] watchdog: machzwd: Mark expected switch fall-through
2019-04-24 17:28 ` Guenter Roeck
@ 2019-04-24 17:36 ` Gustavo A. R. Silva
0 siblings, 0 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2019-04-24 17:36 UTC (permalink / raw)
To: Guenter Roeck; +Cc: Wim Van Sebroeck, linux-watchdog, linux-kernel, Kees Cook
On 4/24/19 12:28 PM, Guenter Roeck wrote:
> On Wed, Apr 24, 2019 at 12:01:03PM -0500, Gustavo A. R. Silva wrote:
>> Hi Guenter,
>>
>> I wonder if you took this in you watchdog-next branch.
>>
>
> It is in branch watchdog-next of
> git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git
>
> waiting for Wim to pick it up.
>
Awesome.
Thank you!
--
Gustavo
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-04-24 17:59 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-10 18:49 [PATCH] watchdog: machzwd: Mark expected switch fall-through Gustavo A. R. Silva
2019-04-10 20:35 ` Guenter Roeck
2019-04-10 20:51 ` Gustavo A. R. Silva
2019-04-24 17:01 ` Gustavo A. R. Silva
2019-04-24 17:28 ` Guenter Roeck
2019-04-24 17:36 ` Gustavo A. R. Silva
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).