diff mbox series

scsi: wd33c93: Mark expected swich fall-through

Message ID 20190729210313.GA5896@embeddedor (mailing list archive)
State Mainlined
Commit c72a9692923f67a0ba862093848d1834259e01c3
Headers show
Series scsi: wd33c93: Mark expected swich fall-through | expand

Commit Message

Gustavo A. R. Silva July 29, 2019, 9:03 p.m. UTC
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;
   ^~~~

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/scsi/wd33c93.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Kees Cook July 29, 2019, 9:48 p.m. UTC | #1
On Mon, Jul 29, 2019 at 04:03:13PM -0500, Gustavo A. R. Silva wrote:
> 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;
>    ^~~~
> 
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Reviewed-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
>  drivers/scsi/wd33c93.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/scsi/wd33c93.c b/drivers/scsi/wd33c93.c
> index fb7b289fa09f..f81046f0e68a 100644
> --- a/drivers/scsi/wd33c93.c
> +++ b/drivers/scsi/wd33c93.c
> @@ -1854,6 +1854,7 @@ round_4(unsigned int x)
>  		case 1: --x;
>  			break;
>  		case 2: ++x;
> +			/* fall through */
>  		case 3: ++x;
>  	}
>  	return x;
> -- 
> 2.22.0
>
Martin K. Petersen Aug. 8, 2019, 1:38 a.m. UTC | #2
Gustavo,

> 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!
diff mbox series

Patch

diff --git a/drivers/scsi/wd33c93.c b/drivers/scsi/wd33c93.c
index fb7b289fa09f..f81046f0e68a 100644
--- a/drivers/scsi/wd33c93.c
+++ b/drivers/scsi/wd33c93.c
@@ -1854,6 +1854,7 @@  round_4(unsigned int x)
 		case 1: --x;
 			break;
 		case 2: ++x;
+			/* fall through */
 		case 3: ++x;
 	}
 	return x;