Skip to contentSkip to conversation

scsi: wd33c93: Mark expected swich fall-through

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

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: wd33c93: Mark expected swich fall-through

Mark switch cases where we are expecting to fall through.

This patch fixes the following warning (Building: m68k):

drivers/scsi/wd33c93.c: In function ‘round_4’:
drivers/scsi/wd33c93.c:1856:11: warning: this statement may fall through [-Wimplicit-fallthrough=]

   case 2: ++x;
           ^~~

drivers/scsi/wd33c93.c:1857:3: note: here
case 3: ++x;
^~~~

---
 drivers/scsi/wd33c93.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/wd33c93.c +1 -0
index fb7b289fa09f..f81046f0e68a 100644
@@ -1854,6 +1854,7 @@ round_4(unsigned int x)
 		case 1: --x;
 			break;
 		case 2: ++x;
+			/* fall through */
 		case 3: ++x;
 	}
 	return x;
Signature · 1 line
2.22.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Gustavo A. R. Silva

Mark switch cases where we are expecting to fall through.

This patch fixes the following warning (Building: m68k):

drivers/scsi/wd33c93.c: In function ‘round_4’:
drivers/scsi/wd33c93.c:1856:11: warning: this statement may fall through [-Wimplicit-fallthrough=]

Quoted 7 lines
   case 2: ++x;
           ^~~
drivers/scsi/wd33c93.c:1857:3: note: here
   case 3: ++x;
   ^~~~

-Kees

Quoted 19 lines
---
 drivers/scsi/wd33c93.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/wd33c93.c +1 -0
index fb7b289fa09f..f81046f0e68a 100644
@@ -1854,6 +1854,7 @@ round_4(unsigned int x)
 		case 1: --x;
 			break;
 		case 2: ++x;
+			/* fall through */
 		case 3: ++x;
 	}
 	return x;
Signature · 1 line
2.22.0
Signature · 1 line
Kees Cook
#2 lore raw
In reply to Gustavo A. R. Silva

Gustavo,

Quoted 8 lines

Mark switch cases where we are expecting to fall through.

This patch fixes the following warning (Building: m68k):

drivers/scsi/wd33c93.c: In function ‘round_4’:
drivers/scsi/wd33c93.c:1856:11: warning: this statement may fall through [-Wimplicit-fallthrough=]

   case 2: ++x;
           ^~~

Applied to 5.4/scsi-queue, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering