ext4: annotate implicit fall throughs
PATCH 1/2 ext4: annotate implicit fall throughs
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=]
--- fs/ext4/hash.c | 2 ++ 1 file changed, 2 insertions(+)
fs/ext4/hash.c +2 -0
@@ -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 ) {
Signature · 1 line
2.19.2
PATCH 2/2 ext4: annotate implicit fall throughs
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=]
--- fs/ext4/indirect.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/ext4/indirect.c +6 -0
@@ -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 : ; }
Signature · 1 line
2.19.2
Quoted 6 lines · Mathieu Malaterre
There is a plan to build the kernel with -Wimplicit-fallthrough and these places in the code produced warnings (W=1). Fix them up.
Quoted 8 lines
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 <[email protected]>
Quoted 55 lines
---
fs/ext4/indirect.c| 6 ++++++1 file changed, 6 insertions(+)fs/ext4/indirect.c +6
-1@@ -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 : ; } --
Quoted 2 lines
2.19.2
Cheers, Andreas
Quoted 11 lines · Mathieu Malaterre
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 <[email protected]>
Thanks, applied.
- Ted
Quoted 6 lines · Mathieu Malaterre
There is a plan to build the kernel with -Wimplicit-fallthrough and these places in the code produced warnings (W=1). Fix them up.
Quoted 6 lines
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 <[email protected]>
Quoted 25 lines
---
fs/ext4/hash.c| 2 ++1 file changed, 2 insertions(+)fs/ext4/hash.c +2
-1@@ -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 ) { --
Quoted 2 lines
2.19.2
Cheers, Andreas
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). 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 <[email protected]>
Thanks, applied.
- Ted