Commit 5937e000 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva

xfs: Fix multiple fall-through warnings for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix
the following warnings by replacing /* fallthrough */ comments,
and its variants, with the new pseudo-keyword macro fallthrough:

fs/xfs/libxfs/xfs_attr.c:487:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
fs/xfs/libxfs/xfs_attr.c:500:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
fs/xfs/libxfs/xfs_attr.c:532:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
fs/xfs/libxfs/xfs_attr.c:594:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
fs/xfs/libxfs/xfs_attr.c:607:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
fs/xfs/libxfs/xfs_attr.c:1410:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
fs/xfs/libxfs/xfs_attr.c:1445:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
fs/xfs/libxfs/xfs_attr.c:1473:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

Notice that Clang doesn't recognize /* fallthrough */ comments as
implicit fall-through markings, so in order to globally enable
-Wimplicit-fallthrough for Clang, these comments need to be
replaced with fallthrough; in the whole codebase.

Link: https://github.com/KSPP/linux/issues/115Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
parent e73f0f0e
...@@ -483,7 +483,7 @@ xfs_attr_set_iter( ...@@ -483,7 +483,7 @@ xfs_attr_set_iter(
if (error) if (error)
return error; return error;
/* fallthrough */ fallthrough;
case XFS_DAS_RM_LBLK: case XFS_DAS_RM_LBLK:
/* Set state in case xfs_attr_rmtval_remove returns -EAGAIN */ /* Set state in case xfs_attr_rmtval_remove returns -EAGAIN */
dac->dela_state = XFS_DAS_RM_LBLK; dac->dela_state = XFS_DAS_RM_LBLK;
...@@ -496,7 +496,7 @@ xfs_attr_set_iter( ...@@ -496,7 +496,7 @@ xfs_attr_set_iter(
return -EAGAIN; return -EAGAIN;
} }
/* fallthrough */ fallthrough;
case XFS_DAS_RD_LEAF: case XFS_DAS_RD_LEAF:
/* /*
* This is the last step for leaf format. Read the block with * This is the last step for leaf format. Read the block with
...@@ -528,7 +528,7 @@ xfs_attr_set_iter( ...@@ -528,7 +528,7 @@ xfs_attr_set_iter(
return error; return error;
} }
/* fallthrough */ fallthrough;
case XFS_DAS_ALLOC_NODE: case XFS_DAS_ALLOC_NODE:
/* /*
* If there was an out-of-line value, allocate the blocks we * If there was an out-of-line value, allocate the blocks we
...@@ -590,7 +590,7 @@ xfs_attr_set_iter( ...@@ -590,7 +590,7 @@ xfs_attr_set_iter(
if (error) if (error)
return error; return error;
/* fallthrough */ fallthrough;
case XFS_DAS_RM_NBLK: case XFS_DAS_RM_NBLK:
/* Set state in case xfs_attr_rmtval_remove returns -EAGAIN */ /* Set state in case xfs_attr_rmtval_remove returns -EAGAIN */
dac->dela_state = XFS_DAS_RM_NBLK; dac->dela_state = XFS_DAS_RM_NBLK;
...@@ -603,7 +603,7 @@ xfs_attr_set_iter( ...@@ -603,7 +603,7 @@ xfs_attr_set_iter(
return -EAGAIN; return -EAGAIN;
} }
/* fallthrough */ fallthrough;
case XFS_DAS_CLR_FLAG: case XFS_DAS_CLR_FLAG:
/* /*
* The last state for node format. Look up the old attr and * The last state for node format. Look up the old attr and
...@@ -1406,7 +1406,7 @@ xfs_attr_remove_iter( ...@@ -1406,7 +1406,7 @@ xfs_attr_remove_iter(
state = dac->da_state; state = dac->da_state;
} }
/* fallthrough */ fallthrough;
case XFS_DAS_RMTBLK: case XFS_DAS_RMTBLK:
dac->dela_state = XFS_DAS_RMTBLK; dac->dela_state = XFS_DAS_RMTBLK;
...@@ -1441,7 +1441,7 @@ xfs_attr_remove_iter( ...@@ -1441,7 +1441,7 @@ xfs_attr_remove_iter(
return -EAGAIN; return -EAGAIN;
} }
/* fallthrough */ fallthrough;
case XFS_DAS_RM_NAME: case XFS_DAS_RM_NAME:
/* /*
* If we came here fresh from a transaction roll, reattach all * If we came here fresh from a transaction roll, reattach all
...@@ -1469,7 +1469,7 @@ xfs_attr_remove_iter( ...@@ -1469,7 +1469,7 @@ xfs_attr_remove_iter(
return -EAGAIN; return -EAGAIN;
} }
/* fallthrough */ fallthrough;
case XFS_DAS_RM_SHRINK: case XFS_DAS_RM_SHRINK:
/* /*
* If the result is small enough, push it all into the inode. * If the result is small enough, push it all into the inode.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment