linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext2: Annotate implicit fall through in __ext2_truncate_blocks
@ 2019-01-24 18:05 Mathieu Malaterre
  2019-01-28 14:51 ` Jan Kara
  0 siblings, 1 reply; 2+ messages in thread
From: Mathieu Malaterre @ 2019-01-24 18:05 UTC (permalink / raw)
  To: Jan Kara; +Cc: Mathieu Malaterre, 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).

This commit removes the following warnings:

  fs/ext2/inode.c:1237:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
  fs/ext2/inode.c:1244:7: warning: this statement may fall through [-Wimplicit-fallthrough=]

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

diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index e4bb9386c045..e64029b1bd50 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -1239,6 +1239,7 @@ static void __ext2_truncate_blocks(struct inode *inode, loff_t offset)
 				mark_inode_dirty(inode);
 				ext2_free_branches(inode, &nr, &nr+1, 1);
 			}
+			/* fall through */
 		case EXT2_IND_BLOCK:
 			nr = i_data[EXT2_DIND_BLOCK];
 			if (nr) {
@@ -1246,6 +1247,7 @@ static void __ext2_truncate_blocks(struct inode *inode, loff_t offset)
 				mark_inode_dirty(inode);
 				ext2_free_branches(inode, &nr, &nr+1, 2);
 			}
+			/* fall through */
 		case EXT2_DIND_BLOCK:
 			nr = i_data[EXT2_TIND_BLOCK];
 			if (nr) {
-- 
2.19.2


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

* Re: [PATCH] ext2: Annotate implicit fall through in __ext2_truncate_blocks
  2019-01-24 18:05 [PATCH] ext2: Annotate implicit fall through in __ext2_truncate_blocks Mathieu Malaterre
@ 2019-01-28 14:51 ` Jan Kara
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2019-01-28 14:51 UTC (permalink / raw)
  To: Mathieu Malaterre; +Cc: Jan Kara, linux-ext4, linux-kernel

On Thu 24-01-19 19:05:04, Mathieu Malaterre wrote:
> There is a plan to build the kernel with -Wimplicit-fallthrough and
> these places in the code produced warnings (W=1).
> 
> This commit removes the following warnings:
> 
>   fs/ext2/inode.c:1237:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
>   fs/ext2/inode.c:1244:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
> 
> Signed-off-by: Mathieu Malaterre <malat@debian.org>

Thanks for the patch! I've added it to my tree.

								Honza

> ---
>  fs/ext2/inode.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
> index e4bb9386c045..e64029b1bd50 100644
> --- a/fs/ext2/inode.c
> +++ b/fs/ext2/inode.c
> @@ -1239,6 +1239,7 @@ static void __ext2_truncate_blocks(struct inode *inode, loff_t offset)
>  				mark_inode_dirty(inode);
>  				ext2_free_branches(inode, &nr, &nr+1, 1);
>  			}
> +			/* fall through */
>  		case EXT2_IND_BLOCK:
>  			nr = i_data[EXT2_DIND_BLOCK];
>  			if (nr) {
> @@ -1246,6 +1247,7 @@ static void __ext2_truncate_blocks(struct inode *inode, loff_t offset)
>  				mark_inode_dirty(inode);
>  				ext2_free_branches(inode, &nr, &nr+1, 2);
>  			}
> +			/* fall through */
>  		case EXT2_DIND_BLOCK:
>  			nr = i_data[EXT2_TIND_BLOCK];
>  			if (nr) {
> -- 
> 2.19.2
> 
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

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

end of thread, other threads:[~2019-01-28 14:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-24 18:05 [PATCH] ext2: Annotate implicit fall through in __ext2_truncate_blocks Mathieu Malaterre
2019-01-28 14:51 ` Jan Kara

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