* [PATCH] ext4: change to use fallthrough macro instead of fallthrough comments
@ 2020-08-10 11:44 Shijie Luo
2020-08-10 13:44 ` Ritesh Harjani
2020-08-18 18:27 ` Theodore Y. Ts'o
0 siblings, 2 replies; 3+ messages in thread
From: Shijie Luo @ 2020-08-10 11:44 UTC (permalink / raw)
To: linux-ext4; +Cc: tytso, jack, riteshh
Change to use fallthrough macro in switch case.
Signed-off-by: Shijie Luo <luoshijie1@huawei.com>
---
fs/ext4/hash.c | 4 ++--
fs/ext4/indirect.c | 12 ++++++------
fs/ext4/readpage.c | 4 ++--
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/fs/ext4/hash.c b/fs/ext4/hash.c
index 3e133793a5a3..2924261226e0 100644
--- a/fs/ext4/hash.c
+++ b/fs/ext4/hash.c
@@ -233,7 +233,7 @@ static int __ext4fs_dirhash(const char *name, int len,
break;
case DX_HASH_HALF_MD4_UNSIGNED:
str2hashbuf = str2hashbuf_unsigned;
- /* fall through */
+ fallthrough;
case DX_HASH_HALF_MD4:
p = name;
while (len > 0) {
@@ -247,7 +247,7 @@ static int __ext4fs_dirhash(const char *name, int len,
break;
case DX_HASH_TEA_UNSIGNED:
str2hashbuf = str2hashbuf_unsigned;
- /* fall through */
+ fallthrough;
case DX_HASH_TEA:
p = name;
while (len > 0) {
diff --git a/fs/ext4/indirect.c b/fs/ext4/indirect.c
index be2b66eb65f7..1217f0fdcb33 100644
--- a/fs/ext4/indirect.c
+++ b/fs/ext4/indirect.c
@@ -1182,21 +1182,21 @@ void ext4_ind_truncate(handle_t *handle, struct inode *inode)
ext4_free_branches(handle, inode, NULL, &nr, &nr+1, 1);
i_data[EXT4_IND_BLOCK] = 0;
}
- /* fall through */
+ fallthrough;
case EXT4_IND_BLOCK:
nr = i_data[EXT4_DIND_BLOCK];
if (nr) {
ext4_free_branches(handle, inode, NULL, &nr, &nr+1, 2);
i_data[EXT4_DIND_BLOCK] = 0;
}
- /* fall through */
+ fallthrough;
case EXT4_DIND_BLOCK:
nr = i_data[EXT4_TIND_BLOCK];
if (nr) {
ext4_free_branches(handle, inode, NULL, &nr, &nr+1, 3);
i_data[EXT4_TIND_BLOCK] = 0;
}
- /* fall through */
+ fallthrough;
case EXT4_TIND_BLOCK:
;
}
@@ -1436,7 +1436,7 @@ int ext4_ind_remove_space(handle_t *handle, struct inode *inode,
ext4_free_branches(handle, inode, NULL, &nr, &nr+1, 1);
i_data[EXT4_IND_BLOCK] = 0;
}
- /* fall through */
+ fallthrough;
case EXT4_IND_BLOCK:
if (++n >= n2)
break;
@@ -1445,7 +1445,7 @@ int ext4_ind_remove_space(handle_t *handle, struct inode *inode,
ext4_free_branches(handle, inode, NULL, &nr, &nr+1, 2);
i_data[EXT4_DIND_BLOCK] = 0;
}
- /* fall through */
+ fallthrough;
case EXT4_DIND_BLOCK:
if (++n >= n2)
break;
@@ -1454,7 +1454,7 @@ int ext4_ind_remove_space(handle_t *handle, struct inode *inode,
ext4_free_branches(handle, inode, NULL, &nr, &nr+1, 3);
i_data[EXT4_TIND_BLOCK] = 0;
}
- /* fall through */
+ fallthrough;
case EXT4_TIND_BLOCK:
;
}
diff --git a/fs/ext4/readpage.c b/fs/ext4/readpage.c
index f2df2db0786c..f014c5e473a9 100644
--- a/fs/ext4/readpage.c
+++ b/fs/ext4/readpage.c
@@ -140,7 +140,7 @@ static void bio_post_read_processing(struct bio_post_read_ctx *ctx)
return;
}
ctx->cur_step++;
- /* fall-through */
+ fallthrough;
case STEP_VERITY:
if (ctx->enabled_steps & (1 << STEP_VERITY)) {
INIT_WORK(&ctx->work, verity_work);
@@ -148,7 +148,7 @@ static void bio_post_read_processing(struct bio_post_read_ctx *ctx)
return;
}
ctx->cur_step++;
- /* fall-through */
+ fallthrough;
default:
__read_end_io(ctx->bio);
}
--
2.19.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ext4: change to use fallthrough macro instead of fallthrough comments
2020-08-10 11:44 [PATCH] ext4: change to use fallthrough macro instead of fallthrough comments Shijie Luo
@ 2020-08-10 13:44 ` Ritesh Harjani
2020-08-18 18:27 ` Theodore Y. Ts'o
1 sibling, 0 replies; 3+ messages in thread
From: Ritesh Harjani @ 2020-08-10 13:44 UTC (permalink / raw)
To: Shijie Luo, linux-ext4; +Cc: tytso, jack
On 8/10/20 5:14 PM, Shijie Luo wrote:
> Change to use fallthrough macro in switch case.
>
> Signed-off-by: Shijie Luo <luoshijie1@huawei.com>
pseudo-keyword macro “fallthrough” should be used as per latest
documentation.
https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
LGTM, feel free to add:
Reviewed-by: Ritesh Harjani <riteshh@linux.ibm.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ext4: change to use fallthrough macro instead of fallthrough comments
2020-08-10 11:44 [PATCH] ext4: change to use fallthrough macro instead of fallthrough comments Shijie Luo
2020-08-10 13:44 ` Ritesh Harjani
@ 2020-08-18 18:27 ` Theodore Y. Ts'o
1 sibling, 0 replies; 3+ messages in thread
From: Theodore Y. Ts'o @ 2020-08-18 18:27 UTC (permalink / raw)
To: Shijie Luo; +Cc: linux-ext4, jack, riteshh
On Mon, Aug 10, 2020 at 07:44:35AM -0400, Shijie Luo wrote:
> Change to use fallthrough macro in switch case.
>
> Signed-off-by: Shijie Luo <luoshijie1@huawei.com>
Applied, thanks.
- Ted
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-08-18 18:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-10 11:44 [PATCH] ext4: change to use fallthrough macro instead of fallthrough comments Shijie Luo
2020-08-10 13:44 ` Ritesh Harjani
2020-08-18 18:27 ` Theodore Y. Ts'o
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).