Skip to contentSkip to conversation

scsi: sun3_scsi: Mark expected switch fall-throughs

PATCH Applied Gustavo A. R. Silva 3 participants 3 messages Jul 29, 2019 – Aug 8, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: sun3_scsi: Mark expected switch fall-throughs

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

---
 drivers/scsi/sun3_scsi.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/scsi/sun3_scsi.c +2 -0
index 3d80ab67a626..955e4c938d49 100644
@@ -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;
Signature · 1 line
2.22.0
Tested-by on v1 1/1
#1 lore raw

Hi Gustavo,

Quoted 9 lines · Gustavo A. R. Silva

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

Thanks!

drivers/scsi/sun3_scsi.c static int sun3scsi_dma_finish(int write_flag) · line 406

Quoted 13 lines
drivers/scsi/sun3_scsi.c +2 -0
@@ -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.

drivers/scsi/sun3_scsi.c static int sun3scsi_dma_finish(int write_flag) · line 408

Quoted 2 lines
drivers/scsi/sun3_scsi.c +0 -0
                case CSR_LEFT_1:
                        *vaddr = (dregs->bpack_hi & 0xff00) >> 8;

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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
#2 lore raw
In reply to Gustavo A. R. Silva

Gustavo,

Quoted 6 lines

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!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering