linux-bcache.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2][next] bcache: Use fallthrough pseudo-keyword
@ 2020-07-27 23:04 Gustavo A. R. Silva
  2020-07-28 12:48 ` Coly Li
  0 siblings, 1 reply; 2+ messages in thread
From: Gustavo A. R. Silva @ 2020-07-27 23:04 UTC (permalink / raw)
  To: Coly Li, Kent Overstreet; +Cc: linux-bcache, linux-kernel, Gustavo A. R. Silva

Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1].

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
Changes in v2:
 - Add missing semicolon.

 drivers/md/bcache/journal.c |  2 +-
 drivers/md/bcache/util.c    | 14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c
index 77fbfd52edcf..c1227bdb57e7 100644
--- a/drivers/md/bcache/journal.c
+++ b/drivers/md/bcache/journal.c
@@ -608,7 +608,7 @@ static void do_journal_discard(struct cache *ca)
 			ca->sb.njournal_buckets;
 
 		atomic_set(&ja->discard_in_flight, DISCARD_READY);
-		/* fallthrough */
+		fallthrough;
 
 	case DISCARD_READY:
 		if (ja->discard_idx == ja->last_idx)
diff --git a/drivers/md/bcache/util.c b/drivers/md/bcache/util.c
index 62fb917f7a4f..ae380bc3992e 100644
--- a/drivers/md/bcache/util.c
+++ b/drivers/md/bcache/util.c
@@ -33,27 +33,27 @@ int bch_ ## name ## _h(const char *cp, type *res)		\
 	case 'y':						\
 	case 'z':						\
 		u++;						\
-		/* fall through */				\
+		fallthrough;					\
 	case 'e':						\
 		u++;						\
-		/* fall through */				\
+		fallthrough;					\
 	case 'p':						\
 		u++;						\
-		/* fall through */				\
+		fallthrough;					\
 	case 't':						\
 		u++;						\
-		/* fall through */				\
+		fallthrough;					\
 	case 'g':						\
 		u++;						\
-		/* fall through */				\
+		fallthrough;					\
 	case 'm':						\
 		u++;						\
-		/* fall through */				\
+		fallthrough;					\
 	case 'k':						\
 		u++;						\
 		if (e++ == cp)					\
 			return -EINVAL;				\
-		/* fall through */				\
+		fallthrough;					\
 	case '\n':						\
 	case '\0':						\
 		if (*e == '\n')					\
-- 
2.27.0


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

* Re: [PATCH v2][next] bcache: Use fallthrough pseudo-keyword
  2020-07-27 23:04 [PATCH v2][next] bcache: Use fallthrough pseudo-keyword Gustavo A. R. Silva
@ 2020-07-28 12:48 ` Coly Li
  0 siblings, 0 replies; 2+ messages in thread
From: Coly Li @ 2020-07-28 12:48 UTC (permalink / raw)
  To: Gustavo A. R. Silva; +Cc: Kent Overstreet, linux-bcache, linux-kernel

On 2020/7/28 07:04, Gustavo A. R. Silva wrote:
> Replace the existing /* fall through */ comments and its variants with
> the new pseudo-keyword macro fallthrough[1].
> 
> [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
> 
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>

I am OK with it, add it to my second for-next series.

Thanks.

Coly Li


> ---
> Changes in v2:
>  - Add missing semicolon.
> 
>  drivers/md/bcache/journal.c |  2 +-
>  drivers/md/bcache/util.c    | 14 +++++++-------
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c
> index 77fbfd52edcf..c1227bdb57e7 100644
> --- a/drivers/md/bcache/journal.c
> +++ b/drivers/md/bcache/journal.c
> @@ -608,7 +608,7 @@ static void do_journal_discard(struct cache *ca)
>  			ca->sb.njournal_buckets;
>  
>  		atomic_set(&ja->discard_in_flight, DISCARD_READY);
> -		/* fallthrough */
> +		fallthrough;
>  
>  	case DISCARD_READY:
>  		if (ja->discard_idx == ja->last_idx)
> diff --git a/drivers/md/bcache/util.c b/drivers/md/bcache/util.c
> index 62fb917f7a4f..ae380bc3992e 100644
> --- a/drivers/md/bcache/util.c
> +++ b/drivers/md/bcache/util.c
> @@ -33,27 +33,27 @@ int bch_ ## name ## _h(const char *cp, type *res)		\
>  	case 'y':						\
>  	case 'z':						\
>  		u++;						\
> -		/* fall through */				\
> +		fallthrough;					\
>  	case 'e':						\
>  		u++;						\
> -		/* fall through */				\
> +		fallthrough;					\
>  	case 'p':						\
>  		u++;						\
> -		/* fall through */				\
> +		fallthrough;					\
>  	case 't':						\
>  		u++;						\
> -		/* fall through */				\
> +		fallthrough;					\
>  	case 'g':						\
>  		u++;						\
> -		/* fall through */				\
> +		fallthrough;					\
>  	case 'm':						\
>  		u++;						\
> -		/* fall through */				\
> +		fallthrough;					\
>  	case 'k':						\
>  		u++;						\
>  		if (e++ == cp)					\
>  			return -EINVAL;				\
> -		/* fall through */				\
> +		fallthrough;					\
>  	case '\n':						\
>  	case '\0':						\
>  		if (*e == '\n')					\
> 


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

end of thread, other threads:[~2020-07-28 12:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-27 23:04 [PATCH v2][next] bcache: Use fallthrough pseudo-keyword Gustavo A. R. Silva
2020-07-28 12:48 ` Coly Li

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