linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: sun3_scsi: Mark expected switch fall-throughs
@ 2019-07-29 14:30 Gustavo A. R. Silva
  2019-07-29 15:39 ` Geert Uytterhoeven
  2019-08-08  1:35 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2019-07-29 14:30 UTC (permalink / raw)
  To: Finn Thain, Michael Schmitz, James E.J. Bottomley, Martin K. Petersen
  Cc: linux-scsi, linux-kernel, Gustavo A. R. Silva,
	Geert Uytterhoeven, Kees Cook

Mark switch cases where we are expecting to fall through.

This patch fixes the following warnings:

drivers/scsi/sun3_scsi.c: warning: this statement may fall through
[-Wimplicit-fallthrough=]:  => 399:9, 403:9

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/scsi/sun3_scsi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/sun3_scsi.c b/drivers/scsi/sun3_scsi.c
index 3d80ab67a626..955e4c938d49 100644
--- a/drivers/scsi/sun3_scsi.c
+++ b/drivers/scsi/sun3_scsi.c
@@ -397,10 +397,12 @@ static int sun3scsi_dma_finish(int write_flag)
 		case CSR_LEFT_3:
 			*vaddr = (dregs->bpack_lo & 0xff00) >> 8;
 			vaddr--;
+			/* Fall through */
 
 		case CSR_LEFT_2:
 			*vaddr = (dregs->bpack_hi & 0x00ff);
 			vaddr--;
+			/* Fall through */
 
 		case CSR_LEFT_1:
 			*vaddr = (dregs->bpack_hi & 0xff00) >> 8;
-- 
2.22.0


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

* Re: [PATCH] scsi: sun3_scsi: Mark expected switch fall-throughs
  2019-07-29 14:30 [PATCH] scsi: sun3_scsi: Mark expected switch fall-throughs Gustavo A. R. Silva
@ 2019-07-29 15:39 ` Geert Uytterhoeven
  2019-08-08  1:35 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2019-07-29 15:39 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Finn Thain, Michael Schmitz, James E.J. Bottomley,
	Martin K. Petersen, scsi, Linux Kernel Mailing List, Kees Cook

Hi Gustavo,

On Mon, Jul 29, 2019 at 4:32 PM Gustavo A. R. Silva
<gustavo@embeddedor.com> wrote:
> Mark switch cases where we are expecting to fall through.
>
> This patch fixes the following warnings:
>
> drivers/scsi/sun3_scsi.c: warning: this statement may fall through
> [-Wimplicit-fallthrough=]:  => 399:9, 403:9
>
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Thanks!
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>

> --- a/drivers/scsi/sun3_scsi.c
> +++ b/drivers/scsi/sun3_scsi.c
> @@ -397,10 +397,12 @@ static int sun3scsi_dma_finish(int write_flag)
>                 case CSR_LEFT_3:
>                         *vaddr = (dregs->bpack_lo & 0xff00) >> 8;
>                         vaddr--;
> +                       /* Fall through */
>
>                 case CSR_LEFT_2:
>                         *vaddr = (dregs->bpack_hi & 0x00ff);
>                         vaddr--;
> +                       /* Fall through */
>

I think it would be clearer if you would drop the blank lines.

>                 case CSR_LEFT_1:
>                         *vaddr = (dregs->bpack_hi & 0xff00) >> 8;

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] 3+ messages in thread

* Re: [PATCH] scsi: sun3_scsi: Mark expected switch fall-throughs
  2019-07-29 14:30 [PATCH] scsi: sun3_scsi: Mark expected switch fall-throughs Gustavo A. R. Silva
  2019-07-29 15:39 ` Geert Uytterhoeven
@ 2019-08-08  1:35 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2019-08-08  1:35 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Finn Thain, Michael Schmitz, James E.J. Bottomley,
	Martin K. Petersen, linux-scsi, linux-kernel, Geert Uytterhoeven,
	Kees Cook


Gustavo,

> Mark switch cases where we are expecting to fall through.
>
> This patch fixes the following warnings:
>
> drivers/scsi/sun3_scsi.c: warning: this statement may fall through
> [-Wimplicit-fallthrough=]:  => 399:9, 403:9

Applied to 5.4/scsi-queue, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2019-08-08  1:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-29 14:30 [PATCH] scsi: sun3_scsi: Mark expected switch fall-throughs Gustavo A. R. Silva
2019-07-29 15:39 ` Geert Uytterhoeven
2019-08-08  1:35 ` Martin K. Petersen

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).