[1/2] ext4: annotate implicit fall throughs

Message ID 20190114203945.20233-1-malat@debian.org
State Awaiting Upstream
Headers show
Series
  • [1/2] ext4: annotate implicit fall throughs
Related show

Commit Message

Mathieu Malaterre Jan. 14, 2019, 8:39 p.m.
There is a plan to build the kernel with -Wimplicit-fallthrough and
these places in the code produced warnings (W=1). Fix them up.

This commit remove the following warnings:

  fs/ext4/hash.c:233:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
  fs/ext4/hash.c:246:15: warning: this statement may fall through [-Wimplicit-fallthrough=]

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 fs/ext4/hash.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Andreas Dilger Jan. 17, 2019, 5:38 p.m. | #1
> On Jan 14, 2019, at 1:39 PM, Mathieu Malaterre <malat@debian.org> wrote:
> 
> There is a plan to build the kernel with -Wimplicit-fallthrough and
> these places in the code produced warnings (W=1). Fix them up.
> 
> This commit remove the following warnings:
> 
>  fs/ext4/hash.c:233:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
>  fs/ext4/hash.c:246:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
> 
> Signed-off-by: Mathieu Malaterre <malat@debian.org>

Reviewed-by: Andreas Dilger <adilger@dilger.ca>

> ---
> fs/ext4/hash.c | 2 ++
> 1 file changed, 2 insertions(+)
> 
> diff --git a/fs/ext4/hash.c b/fs/ext4/hash.c
> index e22dcfab308b..46b24da33a28 100644
> --- a/fs/ext4/hash.c
> +++ b/fs/ext4/hash.c
> @@ -231,6 +231,7 @@ int ext4fs_dirhash(const char *name, int len, struct dx_hash_info *hinfo)
> 		break;
> 	case DX_HASH_HALF_MD4_UNSIGNED:
> 		str2hashbuf = str2hashbuf_unsigned;
> +		/* fall through */
> 	case DX_HASH_HALF_MD4:
> 		p = name;
> 		while (len > 0) {
> @@ -244,6 +245,7 @@ int ext4fs_dirhash(const char *name, int len, struct dx_hash_info *hinfo)
> 		break;
> 	case DX_HASH_TEA_UNSIGNED:
> 		str2hashbuf = str2hashbuf_unsigned;
> +		/* fall through */
> 	case DX_HASH_TEA:
> 		p = name;
> 		while (len > 0) {
> --
> 2.19.2
> 


Cheers, Andreas
Theodore Ts'o Feb. 21, 2019, 3:50 p.m. | #2
On Mon, Jan 14, 2019 at 09:39:43PM +0100, Mathieu Malaterre wrote:
> There is a plan to build the kernel with -Wimplicit-fallthrough and
> these places in the code produced warnings (W=1). Fix them up.
> 
> This commit remove the following warnings:
> 
>   fs/ext4/hash.c:233:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
>   fs/ext4/hash.c:246:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
> 
> Signed-off-by: Mathieu Malaterre <malat@debian.org>

Thanks, applied.

					- Ted

Patch

diff --git a/fs/ext4/hash.c b/fs/ext4/hash.c
index e22dcfab308b..46b24da33a28 100644
--- a/fs/ext4/hash.c
+++ b/fs/ext4/hash.c
@@ -231,6 +231,7 @@  int ext4fs_dirhash(const char *name, int len, struct dx_hash_info *hinfo)
 		break;
 	case DX_HASH_HALF_MD4_UNSIGNED:
 		str2hashbuf = str2hashbuf_unsigned;
+		/* fall through */
 	case DX_HASH_HALF_MD4:
 		p = name;
 		while (len > 0) {
@@ -244,6 +245,7 @@  int ext4fs_dirhash(const char *name, int len, struct dx_hash_info *hinfo)
 		break;
 	case DX_HASH_TEA_UNSIGNED:
 		str2hashbuf = str2hashbuf_unsigned;
+		/* fall through */
 	case DX_HASH_TEA:
 		p = name;
 		while (len > 0) {