[057/141] watchdog: Fix fall-through warnings for Clang

Message ID 713aa26be06d50dd3bb582a3cb71f04787ad5d5b.1605896059.git.gustavoars@kernel.org
State New
Headers show
Series
  • Fix fall-through warnings for Clang
Related show

Commit Message

Gustavo A. R. Silva Nov. 20, 2020, 6:32 p.m.
In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning
by explicitly adding a fallthrough pseudo-keyword instead of letting the
code fall through to the next case.

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
 drivers/watchdog/machzwd.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Gustavo A. R. Silva Nov. 23, 2020, 10:50 p.m. | #1
On Sat, Nov 21, 2020 at 10:49:51AM -0800, Guenter Roeck wrote:
> On Fri, Nov 20, 2020 at 12:32:51PM -0600, Gustavo A. R. Silva wrote:

> > In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning

> > by explicitly adding a fallthrough pseudo-keyword instead of letting the

> > code fall through to the next case.

> > 

> > Link: https://github.com/KSPP/linux/issues/115

> > Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>

> > ---

> >  drivers/watchdog/machzwd.c | 1 +

> >  1 file changed, 1 insertion(+)

> > 

> > diff --git a/drivers/watchdog/machzwd.c b/drivers/watchdog/machzwd.c

> > index 743377c5b173..73f2221f6222 100644

> > --- a/drivers/watchdog/machzwd.c

> > +++ b/drivers/watchdog/machzwd.c

> > @@ -174,6 +174,7 @@ static inline void zf_set_timer(unsigned short new, unsigned char n)

> >  		fallthrough;

> >  	case WD2:

> >  		zf_writeb(COUNTER_2, new > 0xff ? 0xff : new);

> > +		fallthrough;

> 

> fallthrough to return ? Oh well, this is an old style driver anyway,

> so I guess who cares.


:)

> Acked-by: Guenter Roeck <linux@roeck-us.net>


Thanks, Guenter.
--
Gustavo
Gustavo A. R. Silva March 4, 2021, 11:04 p.m. | #2
Hi all,

It's been more than 3 months; who can take this, please? :)

Thanks
--
Gustavo

On Fri, Nov 20, 2020 at 12:32:51PM -0600, Gustavo A. R. Silva wrote:
> In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning
> by explicitly adding a fallthrough pseudo-keyword instead of letting the
> code fall through to the next case.
> 
> Link: https://github.com/KSPP/linux/issues/115
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> ---
>  drivers/watchdog/machzwd.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/watchdog/machzwd.c b/drivers/watchdog/machzwd.c
> index 743377c5b173..73f2221f6222 100644
> --- a/drivers/watchdog/machzwd.c
> +++ b/drivers/watchdog/machzwd.c
> @@ -174,6 +174,7 @@ static inline void zf_set_timer(unsigned short new, unsigned char n)
>  		fallthrough;
>  	case WD2:
>  		zf_writeb(COUNTER_2, new > 0xff ? 0xff : new);
> +		fallthrough;
>  	default:
>  		return;
>  	}
> -- 
> 2.27.0
>
Guenter Roeck March 5, 2021, 4:15 a.m. | #3
On Thu, Mar 04, 2021 at 05:04:06PM -0600, Gustavo A. R. Silva wrote:
> Hi all,

> 

> It's been more than 3 months; who can take this, please? :)

> 


I am not in favor of cosmetic patches for old drivers,
and I am not going to provide tags for them anymore.
The driver should be converted to use the watchdog core,
or it should be dropped.

Guenter
Gustavo A. R. Silva March 5, 2021, 5:21 a.m. | #4
On Thu, Mar 04, 2021 at 08:15:12PM -0800, Guenter Roeck wrote:
> On Thu, Mar 04, 2021 at 05:04:06PM -0600, Gustavo A. R. Silva wrote:

> > Hi all,

> > 

> > It's been more than 3 months; who can take this, please? :)

> > 

> 

> I am not in favor of cosmetic patches for old drivers,


Me either. However, this is not a cosmetic patch[1].

> and I am not going to provide tags for them anymore.

> The driver should be converted to use the watchdog core,

> or it should be dropped.


Is it OK with you if I carry this in my tree for a future pull-request
to Linus?

Thanks!
--
Gustavo

[1] https://github.com/KSPP/linux/issues/115

Patch

diff --git a/drivers/watchdog/machzwd.c b/drivers/watchdog/machzwd.c
index 743377c5b173..73f2221f6222 100644
--- a/drivers/watchdog/machzwd.c
+++ b/drivers/watchdog/machzwd.c
@@ -174,6 +174,7 @@  static inline void zf_set_timer(unsigned short new, unsigned char n)
 		fallthrough;
 	case WD2:
 		zf_writeb(COUNTER_2, new > 0xff ? 0xff : new);
+		fallthrough;
 	default:
 		return;
 	}