Skip to contentSkip to conversation

ext2: Annotate implicit fall through in __ext2_truncate_blocks

PATCH In review Mathieu Malaterre 2 participants 2 messages Jan 24, 2019 – Jan 28, 2019 ext2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext2: Annotate implicit fall through in __ext2_truncate_blocks

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=]

---
 fs/ext2/inode.c | 2 ++
 1 file changed, 2 insertions(+)
fs/ext2/inode.c +2 -0
index e4bb9386c045..e64029b1bd50 100644
@@ -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) {
Signature · 1 line
2.19.2
#1 lore raw
Quoted 9 lines · Mathieu Malaterre

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=]

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

Honza

Quoted 28 lines
---
 fs/ext2/inode.c | 2 ++
 1 file changed, 2 insertions(+)
fs/ext2/inode.c +2 -0
index e4bb9386c045..e64029b1bd50 100644
@@ -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) {
Signature · 1 line
2.19.2
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR