linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ext4: annotate implicit fall throughs
@ 2019-01-14 20:39 Mathieu Malaterre
  2019-01-14 20:39 ` [PATCH 2/2] " Mathieu Malaterre
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Mathieu Malaterre @ 2019-01-14 20:39 UTC (permalink / raw)
  To: Theodore Ts'o
  Cc: Mathieu Malaterre, Andreas Dilger, linux-ext4, linux-kernel

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(+)

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


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

* [PATCH 2/2] ext4: annotate implicit fall throughs
  2019-01-14 20:39 [PATCH 1/2] ext4: annotate implicit fall throughs Mathieu Malaterre
@ 2019-01-14 20:39 ` Mathieu Malaterre
  2019-01-17 17:40   ` Andreas Dilger
  2019-02-21 15:52   ` Theodore Y. Ts'o
  2019-01-17 17:38 ` [PATCH 1/2] " Andreas Dilger
  2019-02-21 15:50 ` Theodore Y. Ts'o
  2 siblings, 2 replies; 6+ messages in thread
From: Mathieu Malaterre @ 2019-01-14 20:39 UTC (permalink / raw)
  To: Theodore Ts'o
  Cc: Mathieu Malaterre, Andreas Dilger, linux-ext4, linux-kernel

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/indirect.c:1182:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
  fs/ext4/indirect.c:1188:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
  fs/ext4/indirect.c:1432:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
  fs/ext4/indirect.c:1440:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

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

diff --git a/fs/ext4/indirect.c b/fs/ext4/indirect.c
index bf7fa1507e81..c2225f0d31b5 100644
--- a/fs/ext4/indirect.c
+++ b/fs/ext4/indirect.c
@@ -1183,18 +1183,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 */
 	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 */
 	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 */
 	case EXT4_TIND_BLOCK:
 		;
 	}
@@ -1433,6 +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 */
 	case EXT4_IND_BLOCK:
 		if (++n >= n2)
 			return 0;
@@ -1441,6 +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 */
 	case EXT4_DIND_BLOCK:
 		if (++n >= n2)
 			return 0;
@@ -1449,6 +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 */
 	case EXT4_TIND_BLOCK:
 		;
 	}
-- 
2.19.2


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

* Re: [PATCH 1/2] ext4: annotate implicit fall throughs
  2019-01-14 20:39 [PATCH 1/2] ext4: annotate implicit fall throughs Mathieu Malaterre
  2019-01-14 20:39 ` [PATCH 2/2] " Mathieu Malaterre
@ 2019-01-17 17:38 ` Andreas Dilger
  2019-02-21 15:50 ` Theodore Y. Ts'o
  2 siblings, 0 replies; 6+ messages in thread
From: Andreas Dilger @ 2019-01-17 17:38 UTC (permalink / raw)
  To: Mathieu Malaterre
  Cc: Theodore Ts'o, Ext4 Developers List, Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 1376 bytes --]


> 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






[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 873 bytes --]

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

* Re: [PATCH 2/2] ext4: annotate implicit fall throughs
  2019-01-14 20:39 ` [PATCH 2/2] " Mathieu Malaterre
@ 2019-01-17 17:40   ` Andreas Dilger
  2019-02-21 15:52   ` Theodore Y. Ts'o
  1 sibling, 0 replies; 6+ messages in thread
From: Andreas Dilger @ 2019-01-17 17:40 UTC (permalink / raw)
  To: Mathieu Malaterre
  Cc: Theodore Ts'o, Ext4 Developers List, Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 2545 bytes --]


> 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/indirect.c:1182:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
>  fs/ext4/indirect.c:1188:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
>  fs/ext4/indirect.c:1432:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
>  fs/ext4/indirect.c:1440:6: 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/indirect.c | 6 ++++++
> 1 file changed, 6 insertions(+)
> 
> diff --git a/fs/ext4/indirect.c b/fs/ext4/indirect.c
> index bf7fa1507e81..c2225f0d31b5 100644
> --- a/fs/ext4/indirect.c
> +++ b/fs/ext4/indirect.c
> @@ -1183,18 +1183,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 */
> 	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 */
> 	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 */
> 	case EXT4_TIND_BLOCK:
> 		;
> 	}
> @@ -1433,6 +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 */
> 	case EXT4_IND_BLOCK:
> 		if (++n >= n2)
> 			return 0;
> @@ -1441,6 +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 */
> 	case EXT4_DIND_BLOCK:
> 		if (++n >= n2)
> 			return 0;
> @@ -1449,6 +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 */
> 	case EXT4_TIND_BLOCK:
> 		;
> 	}
> --
> 2.19.2
> 


Cheers, Andreas






[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 873 bytes --]

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

* Re: [PATCH 1/2] ext4: annotate implicit fall throughs
  2019-01-14 20:39 [PATCH 1/2] ext4: annotate implicit fall throughs Mathieu Malaterre
  2019-01-14 20:39 ` [PATCH 2/2] " Mathieu Malaterre
  2019-01-17 17:38 ` [PATCH 1/2] " Andreas Dilger
@ 2019-02-21 15:50 ` Theodore Y. Ts'o
  2 siblings, 0 replies; 6+ messages in thread
From: Theodore Y. Ts'o @ 2019-02-21 15:50 UTC (permalink / raw)
  To: Mathieu Malaterre; +Cc: Andreas Dilger, linux-ext4, linux-kernel

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

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

* Re: [PATCH 2/2] ext4: annotate implicit fall throughs
  2019-01-14 20:39 ` [PATCH 2/2] " Mathieu Malaterre
  2019-01-17 17:40   ` Andreas Dilger
@ 2019-02-21 15:52   ` Theodore Y. Ts'o
  1 sibling, 0 replies; 6+ messages in thread
From: Theodore Y. Ts'o @ 2019-02-21 15:52 UTC (permalink / raw)
  To: Mathieu Malaterre; +Cc: Andreas Dilger, linux-ext4, linux-kernel

On Mon, Jan 14, 2019 at 09:39:44PM +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/indirect.c:1182:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
>   fs/ext4/indirect.c:1188:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
>   fs/ext4/indirect.c:1432:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
>   fs/ext4/indirect.c:1440:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
> 
> Signed-off-by: Mathieu Malaterre <malat@debian.org>

Thanks, applied.

					- Ted

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

end of thread, other threads:[~2019-02-21 15:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-14 20:39 [PATCH 1/2] ext4: annotate implicit fall throughs Mathieu Malaterre
2019-01-14 20:39 ` [PATCH 2/2] " Mathieu Malaterre
2019-01-17 17:40   ` Andreas Dilger
2019-02-21 15:52   ` Theodore Y. Ts'o
2019-01-17 17:38 ` [PATCH 1/2] " Andreas Dilger
2019-02-21 15:50 ` 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).