linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fbdev: sh7760fb: document fallthrough cases
@ 2021-11-15  6:32 Randy Dunlap
  2021-11-15  6:51 ` Gustavo A. R. Silva
  2021-11-15  8:35 ` Geert Uytterhoeven
  0 siblings, 2 replies; 4+ messages in thread
From: Randy Dunlap @ 2021-11-15  6:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Gustavo A. R. Silva, Nobuhiro Iwamatsu,
	Manuel Lauss, Yoshinori Sato, Rich Felker, linux-sh, linux-fbdev,
	dri-devel

Fix fallthrough warnings in sh776fb.c:

../drivers/video/fbdev/sh7760fb.c: In function 'sh7760fb_get_color_info':
../drivers/video/fbdev/sh7760fb.c:138:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
  138 |                 lgray = 1;
../drivers/video/fbdev/sh7760fb.c:143:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
  143 |                 lgray = 1;

Just document the current state of code execution/flow.

Fixes: 4a25e41831ee ("video: sh7760fb: SH7760/SH7763 LCDC framebuffer driver")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Cc: Manuel Lauss <mano@roarinelk.homelinux.net>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: linux-sh@vger.kernel.org
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
---
 drivers/video/fbdev/sh7760fb.c |    2 ++
 1 file changed, 2 insertions(+)

--- linux-next-20211112.orig/drivers/video/fbdev/sh7760fb.c
+++ linux-next-20211112/drivers/video/fbdev/sh7760fb.c
@@ -136,11 +136,13 @@ static int sh7760fb_get_color_info(struc
 		break;
 	case LDDFR_4BPP_MONO:
 		lgray = 1;
+		fallthrough;
 	case LDDFR_4BPP:
 		lbpp = 4;
 		break;
 	case LDDFR_6BPP_MONO:
 		lgray = 1;
+		fallthrough;
 	case LDDFR_8BPP:
 		lbpp = 8;
 		break;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fbdev: sh7760fb: document fallthrough cases
  2021-11-15  6:32 [PATCH] fbdev: sh7760fb: document fallthrough cases Randy Dunlap
@ 2021-11-15  6:51 ` Gustavo A. R. Silva
  2021-11-15  8:35 ` Geert Uytterhoeven
  1 sibling, 0 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2021-11-15  6:51 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-kernel, Nobuhiro Iwamatsu, Manuel Lauss, Yoshinori Sato,
	Rich Felker, linux-sh, linux-fbdev, dri-devel

On Sun, Nov 14, 2021 at 10:32:57PM -0800, Randy Dunlap wrote:
> Fix fallthrough warnings in sh776fb.c:
> 
> ../drivers/video/fbdev/sh7760fb.c: In function 'sh7760fb_get_color_info':
> ../drivers/video/fbdev/sh7760fb.c:138:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
>   138 |                 lgray = 1;
> ../drivers/video/fbdev/sh7760fb.c:143:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
>   143 |                 lgray = 1;
> 
> Just document the current state of code execution/flow.
> 
> Fixes: 4a25e41831ee ("video: sh7760fb: SH7760/SH7763 LCDC framebuffer driver")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
> Cc: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
> Cc: Manuel Lauss <mano@roarinelk.homelinux.net>
> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> Cc: Rich Felker <dalias@libc.org>
> Cc: linux-sh@vger.kernel.org
> Cc: linux-fbdev@vger.kernel.org
> Cc: dri-devel@lists.freedesktop.org

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

Thanks, Randy.
--
Gustavo

> ---
>  drivers/video/fbdev/sh7760fb.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> --- linux-next-20211112.orig/drivers/video/fbdev/sh7760fb.c
> +++ linux-next-20211112/drivers/video/fbdev/sh7760fb.c
> @@ -136,11 +136,13 @@ static int sh7760fb_get_color_info(struc
>  		break;
>  	case LDDFR_4BPP_MONO:
>  		lgray = 1;
> +		fallthrough;
>  	case LDDFR_4BPP:
>  		lbpp = 4;
>  		break;
>  	case LDDFR_6BPP_MONO:
>  		lgray = 1;
> +		fallthrough;
>  	case LDDFR_8BPP:
>  		lbpp = 8;
>  		break;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fbdev: sh7760fb: document fallthrough cases
  2021-11-15  6:32 [PATCH] fbdev: sh7760fb: document fallthrough cases Randy Dunlap
  2021-11-15  6:51 ` Gustavo A. R. Silva
@ 2021-11-15  8:35 ` Geert Uytterhoeven
  2021-11-15 23:30   ` Gustavo A. R. Silva
  1 sibling, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2021-11-15  8:35 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Linux Kernel Mailing List, Gustavo A. R. Silva,
	Nobuhiro Iwamatsu, Manuel Lauss, Yoshinori Sato, Rich Felker,
	Linux-sh list, Linux Fbdev development list, DRI Development

On Mon, Nov 15, 2021 at 7:33 AM Randy Dunlap <rdunlap@infradead.org> wrote:
> Fix fallthrough warnings in sh776fb.c:
>
> ../drivers/video/fbdev/sh7760fb.c: In function 'sh7760fb_get_color_info':
> ../drivers/video/fbdev/sh7760fb.c:138:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
>   138 |                 lgray = 1;
> ../drivers/video/fbdev/sh7760fb.c:143:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
>   143 |                 lgray = 1;
>
> Just document the current state of code execution/flow.
>
> Fixes: 4a25e41831ee ("video: sh7760fb: SH7760/SH7763 LCDC framebuffer driver")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>

Section 30.4.4 ("Data Format") of the SH7760 Group Hardware
Manual confirms fall-through is appropriate here (especially for
the odd 6 bpp mode).

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fbdev: sh7760fb: document fallthrough cases
  2021-11-15  8:35 ` Geert Uytterhoeven
@ 2021-11-15 23:30   ` Gustavo A. R. Silva
  0 siblings, 0 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2021-11-15 23:30 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Randy Dunlap, Linux Kernel Mailing List, Nobuhiro Iwamatsu,
	Manuel Lauss, Yoshinori Sato, Rich Felker, Linux-sh list,
	Linux Fbdev development list, DRI Development, linux-hardening

On Mon, Nov 15, 2021 at 09:35:09AM +0100, Geert Uytterhoeven wrote:
> On Mon, Nov 15, 2021 at 7:33 AM Randy Dunlap <rdunlap@infradead.org> wrote:
> > Fix fallthrough warnings in sh776fb.c:
> >
> > ../drivers/video/fbdev/sh7760fb.c: In function 'sh7760fb_get_color_info':
> > ../drivers/video/fbdev/sh7760fb.c:138:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
> >   138 |                 lgray = 1;
> > ../drivers/video/fbdev/sh7760fb.c:143:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
> >   143 |                 lgray = 1;
> >
> > Just document the current state of code execution/flow.
> >
> > Fixes: 4a25e41831ee ("video: sh7760fb: SH7760/SH7763 LCDC framebuffer driver")
> > Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> 
> Section 30.4.4 ("Data Format") of the SH7760 Group Hardware
> Manual confirms fall-through is appropriate here (especially for
> the odd 6 bpp mode).
> 
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

I'm taking this in my -next tree[1].

Thanks
--
Gustavo

[1] https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/log/?h=for-next/kspp-misc-fixes

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-16  0:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-15  6:32 [PATCH] fbdev: sh7760fb: document fallthrough cases Randy Dunlap
2021-11-15  6:51 ` Gustavo A. R. Silva
2021-11-15  8:35 ` Geert Uytterhoeven
2021-11-15 23:30   ` 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).