diff mbox

[03/16] bcache: Annotate switch fall-through

Message ID 20180315150814.9412-4-bart.vanassche@wdc.com (mailing list archive)
State New, archived
Headers show

Commit Message

Bart Van Assche March 15, 2018, 3:08 p.m. UTC
This patch avoids that building with W=1 triggers complaints about
switch fall-throughs.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
---
 drivers/md/bcache/util.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Coly Li March 15, 2018, 3:48 p.m. UTC | #1
On 15/03/2018 11:08 PM, Bart Van Assche wrote:
> This patch avoids that building with W=1 triggers complaints about
> switch fall-throughs.
> 
> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>

Reviewed-by: Coly Li <colyli@suse.de>

Thanks.

Coly Li

> ---
>  drivers/md/bcache/util.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/md/bcache/util.c b/drivers/md/bcache/util.c
> index a23cd6a14b74..6198041f0ee2 100644
> --- a/drivers/md/bcache/util.c
> +++ b/drivers/md/bcache/util.c
> @@ -32,20 +32,27 @@ int bch_ ## name ## _h(const char *cp, type *res)		\
>  	case 'y':						\
>  	case 'z':						\
>  		u++;						\
> +		/* fall through */				\
>  	case 'e':						\
>  		u++;						\
> +		/* fall through */				\
>  	case 'p':						\
>  		u++;						\
> +		/* fall through */				\
>  	case 't':						\
>  		u++;						\
> +		/* fall through */				\
>  	case 'g':						\
>  		u++;						\
> +		/* fall through */				\
>  	case 'm':						\
>  		u++;						\
> +		/* fall through */				\
>  	case 'k':						\
>  		u++;						\
>  		if (e++ == cp)					\
>  			return -EINVAL;				\
> +		/* fall through */				\
>  	case '\n':						\
>  	case '\0':						\
>  		if (*e == '\n')					\
>
Michael Lyle March 16, 2018, 6:51 p.m. UTC | #2
On 03/15/2018 08:08 AM, Bart Van Assche wrote:
> This patch avoids that building with W=1 triggers complaints about
> switch fall-throughs.
> 
> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>

LGTM, applying.
diff mbox

Patch

diff --git a/drivers/md/bcache/util.c b/drivers/md/bcache/util.c
index a23cd6a14b74..6198041f0ee2 100644
--- a/drivers/md/bcache/util.c
+++ b/drivers/md/bcache/util.c
@@ -32,20 +32,27 @@  int bch_ ## name ## _h(const char *cp, type *res)		\
 	case 'y':						\
 	case 'z':						\
 		u++;						\
+		/* fall through */				\
 	case 'e':						\
 		u++;						\
+		/* fall through */				\
 	case 'p':						\
 		u++;						\
+		/* fall through */				\
 	case 't':						\
 		u++;						\
+		/* fall through */				\
 	case 'g':						\
 		u++;						\
+		/* fall through */				\
 	case 'm':						\
 		u++;						\
+		/* fall through */				\
 	case 'k':						\
 		u++;						\
 		if (e++ == cp)					\
 			return -EINVAL;				\
+		/* fall through */				\
 	case '\n':						\
 	case '\0':						\
 		if (*e == '\n')					\