xfs: Convert to use the preferred fallthrough macro
PATCH 1/1 xfs: Convert to use the preferred fallthrough macro
Convert the uses of fallthrough comments to fallthrough macro. Please see commit 294f69e662d1 ("compiler_attributes.h: Add 'fallthrough' pseudo keyword for switch/case use") for detail.
--- fs/xfs/libxfs/xfs_ag_resv.c | 4 ++-- fs/xfs/libxfs/xfs_da_btree.c | 2 +- fs/xfs/scrub/bmap.c | 2 +- fs/xfs/scrub/btree.c | 2 +- fs/xfs/scrub/common.c | 6 +++--- fs/xfs/scrub/dabtree.c | 2 +- fs/xfs/scrub/repair.c | 2 +- fs/xfs/xfs_bmap_util.c | 2 +- fs/xfs/xfs_file.c | 2 +- fs/xfs/xfs_fsmap.c | 2 +- fs/xfs/xfs_ioctl.c | 2 +- fs/xfs/xfs_trans_buf.c | 2 +- 12 files changed, 15 insertions(+), 15 deletions(-)
fs/xfs/libxfs/xfs_ag_resv.c +2 -2
@@ -338,7 +338,7 @@ xfs_ag_resv_alloc_extent(break ;default :ASSERT (0 ); -/* fall through */ + fallthrough;case XFS_AG_RESV_NONE : field = args->wasdel ?XFS_TRANS_SB_RES_FDBLOCKS :XFS_TRANS_SB_FDBLOCKS ;
@@ -380,7 +380,7 @@ xfs_ag_resv_free_extent(break ;default :ASSERT (0 ); -/* fall through */ + fallthrough;case XFS_AG_RESV_NONE :xfs_trans_mod_sb (tp,XFS_TRANS_SB_FDBLOCKS , (int64_t )len);return ;
fs/xfs/libxfs/xfs_da_btree.c +1 -1
@@ -282,7 +282,7 @@ xfs_da3_node_read_verify( __this_address);break ; } -/* fall through */ + fallthrough;case XFS_DA_NODE_MAGIC : fa =xfs_da3_node_verify (bp);if (fa)
fs/xfs/scrub/bmap.c +1 -1
@@ -270,7 +270,7 @@ xchk_bmap_iextent_xref(case XFS_DATA_FORK :if (xfs_is_reflink_inode (info->sc->ip))break ; -/* fall through */ + fallthrough;case XFS_ATTR_FORK :xchk_xref_is_not_shared (info->sc, agbno, irec->br_blockcount);
fs/xfs/scrub/btree.c +1 -1
@@ -43,7 +43,7 @@ __xchk_btree_process_error(/* Note the badness but don't abort. */ sc->sm->sm_flags |= errflag; *error =0 ; -/* fall through */ + fallthrough;default :if (cur->bc_flags &XFS_BTREE_ROOT_IN_INODE ) trace_xchk_ifork_btree_op_error(sc, cur, level,
fs/xfs/scrub/common.c +3 -3
@@ -81,7 +81,7 @@ __xchk_process_error(/* Note the badness but don't abort. */ sc->sm->sm_flags |= errflag; *error =0 ; -/* fall through */ + fallthrough;default :trace_xchk_op_error (sc, agno, bno, *error, ret_ip);
@@ -134,7 +134,7 @@ __xchk_fblock_process_error(/* Note the badness but don't abort. */ sc->sm->sm_flags |= errflag; *error =0 ; -/* fall through */ + fallthrough;default :trace_xchk_file_op_error (sc, whichfork, offset, *error, ret_ip);
@@ -713,7 +713,7 @@ xchk_get_inode(if (error)return -ENOENT ; error = -EFSCORRUPTED ; -/* fall through */ + fallthrough;default : trace_xchk_op_error(sc, XFS_INO_TO_AGNO(mp, sc->sm->sm_ino),
fs/xfs/scrub/dabtree.c +1 -1
@@ -47,7 +47,7 @@ xchk_da_process_error(/* Note the badness but don't abort. */ sc->sm->sm_flags |=XFS_SCRUB_OFLAG_CORRUPT ; *error =0 ; -/* fall through */ + fallthrough;default : trace_xchk_file_op_error(sc, ds->dargs.whichfork, xfs_dir2_da_to_db(ds->dargs.geo,
fs/xfs/scrub/repair.c +1 -1
@@ -944,7 +944,7 @@ xrep_ino_dqattach(xrep_force_quotacheck (sc,XFS_DQTYPE_GROUP );if (XFS_IS_PQUOTA_ON (sc->mp) && !sc->ip->i_pdquot)xrep_force_quotacheck (sc,XFS_DQTYPE_PROJ ); -/* fall through */ + fallthrough;case -ESRCH : error =0 ;break ;
fs/xfs/xfs_bmap_util.c +1 -1
@@ -244,7 +244,7 @@ xfs_bmap_count_blocks(*/ *count += btblocks -1 ; -/* fall through */ + fallthrough;case XFS_DINODE_FMT_EXTENTS : *nextents =xfs_bmap_count_leaves (ifp, count);break ;
fs/xfs/xfs_file.c +1 -1
@@ -772,7 +772,7 @@ xfs_break_layouts( error =xfs_break_dax_layouts (inode, &retry);if (error || retry)break ; -/* fall through */ + fallthrough;case BREAK_WRITE : error =xfs_break_leased_layouts (inode, iolock, &retry);break ;
fs/xfs/xfs_fsmap.c +1 -1
@@ -100,7 +100,7 @@ xfs_fsmap_owner_to_rmap( dest->rm_owner =XFS_RMAP_OWN_COW ;break ;case XFS_FMR_OWN_DEFECTIVE :/* not implemented */ -/* fall through */ + fallthrough;default :return -EINVAL ; }
fs/xfs/xfs_ioctl.c +1 -1
@@ -557,7 +557,7 @@ xfs_ioc_attrmulti_one(case ATTR_OP_REMOVE : value =NULL ; *len =0 ; -/* fall through */ + fallthrough;case ATTR_OP_SET : error =mnt_want_write_file (parfilp);if (error)
fs/xfs/xfs_trans_buf.c +1 -1
@@ -310,7 +310,7 @@ xfs_trans_read_buf_map(default :if (tp && (tp->t_flags &XFS_TRANS_DIRTY ))xfs_force_shutdown (tp->t_mountp,SHUTDOWN_META_IO_ERROR ); -/* fall through */ + fallthrough;case -ENOMEM :case -EAGAIN :return error;
Signature · 1 line
2.19.1
Darrick J. Wong
NAKQuoted 6 lines · Miaohe Lin
Convert the uses of fallthrough comments to fallthrough macro. Please see commit
294f69e662d1("compiler_attributes.h: Add 'fallthrough' pseudo keyword for switch/case use") for detail.Signed-off-by Hongxiang Lou <[email protected]>Signed-off-by Miaohe Lin <[email protected]>
NAK.
From the /previous/ attempt[0] to shovel in this compliance bullshit[1] that will do nothing but increase the cost of rebasing developers' trees, I'll just wait until "...the C17/C18 [[fallthrough]] syntax is more commonly supported by C compilers, static analyzers, and IDEs, [and] switch to using that syntax". Then I only have to accept the cost of this *once*.
If you feel really passionate about ramming a bunch of pointless churn into the kernel tree to make my life more painful, send this to Linus and let him make the change.
--D
[0] https://lore.kernel.org/linux-xfs/20200707200504.GA4796@embeddedor/
Quoted 201 lines
--- fs/xfs/libxfs/xfs_ag_resv.c | 4 ++-- fs/xfs/libxfs/xfs_da_btree.c | 2 +- fs/xfs/scrub/bmap.c | 2 +- fs/xfs/scrub/btree.c | 2 +- fs/xfs/scrub/common.c | 6 +++--- fs/xfs/scrub/dabtree.c | 2 +- fs/xfs/scrub/repair.c | 2 +- fs/xfs/xfs_bmap_util.c | 2 +- fs/xfs/xfs_file.c | 2 +- fs/xfs/xfs_fsmap.c | 2 +- fs/xfs/xfs_ioctl.c | 2 +- fs/xfs/xfs_trans_buf.c | 2 +- 12 files changed, 15 insertions(+), 15 deletions(-)fs/xfs/libxfs/xfs_ag_resv.c +2
-2@@ -338,7 +338,7 @@ xfs_ag_resv_alloc_extent(break ;default :ASSERT (0 ); -/* fall through */ + fallthrough;case XFS_AG_RESV_NONE : field = args->wasdel ?XFS_TRANS_SB_RES_FDBLOCKS :XFS_TRANS_SB_FDBLOCKS ;@@ -380,7 +380,7 @@ xfs_ag_resv_free_extent(break ;default :ASSERT (0 ); -/* fall through */ + fallthrough;case XFS_AG_RESV_NONE :xfs_trans_mod_sb (tp,XFS_TRANS_SB_FDBLOCKS , (int64_t )len);return ;fs/xfs/libxfs/xfs_da_btree.c +1
-1@@ -282,7 +282,7 @@ xfs_da3_node_read_verify( __this_address);break ; } -/* fall through */ + fallthrough;case XFS_DA_NODE_MAGIC : fa =xfs_da3_node_verify (bp);if (fa)fs/xfs/scrub/bmap.c +1
-1@@ -270,7 +270,7 @@ xchk_bmap_iextent_xref(case XFS_DATA_FORK :if (xfs_is_reflink_inode (info->sc->ip))break ; -/* fall through */ + fallthrough;case XFS_ATTR_FORK :xchk_xref_is_not_shared (info->sc, agbno, irec->br_blockcount);fs/xfs/scrub/btree.c +1
-1@@ -43,7 +43,7 @@ __xchk_btree_process_error(/* Note the badness but don't abort. */ sc->sm->sm_flags |= errflag; *error =0 ; -/* fall through */ + fallthrough;default :if (cur->bc_flags &XFS_BTREE_ROOT_IN_INODE ) trace_xchk_ifork_btree_op_error(sc, cur, level,fs/xfs/scrub/common.c +3
-3@@ -81,7 +81,7 @@ __xchk_process_error(/* Note the badness but don't abort. */ sc->sm->sm_flags |= errflag; *error =0 ; -/* fall through */ + fallthrough;default :trace_xchk_op_error (sc, agno, bno, *error, ret_ip);@@ -134,7 +134,7 @@ __xchk_fblock_process_error(/* Note the badness but don't abort. */ sc->sm->sm_flags |= errflag; *error =0 ; -/* fall through */ + fallthrough;default :trace_xchk_file_op_error (sc, whichfork, offset, *error, ret_ip);@@ -713,7 +713,7 @@ xchk_get_inode(if (error)return -ENOENT ; error = -EFSCORRUPTED ; -/* fall through */ + fallthrough;default : trace_xchk_op_error(sc, XFS_INO_TO_AGNO(mp, sc->sm->sm_ino),fs/xfs/scrub/dabtree.c +1
-1@@ -47,7 +47,7 @@ xchk_da_process_error(/* Note the badness but don't abort. */ sc->sm->sm_flags |=XFS_SCRUB_OFLAG_CORRUPT ; *error =0 ; -/* fall through */ + fallthrough;default : trace_xchk_file_op_error(sc, ds->dargs.whichfork, xfs_dir2_da_to_db(ds->dargs.geo,fs/xfs/scrub/repair.c +1
-1@@ -944,7 +944,7 @@ xrep_ino_dqattach(xrep_force_quotacheck (sc,XFS_DQTYPE_GROUP );if (XFS_IS_PQUOTA_ON (sc->mp) && !sc->ip->i_pdquot)xrep_force_quotacheck (sc,XFS_DQTYPE_PROJ ); -/* fall through */ + fallthrough;case -ESRCH : error =0 ;break ;fs/xfs/xfs_bmap_util.c +1
-1@@ -244,7 +244,7 @@ xfs_bmap_count_blocks(*/ *count += btblocks -1 ; -/* fall through */ + fallthrough;case XFS_DINODE_FMT_EXTENTS : *nextents =xfs_bmap_count_leaves (ifp, count);break ;fs/xfs/xfs_file.c +1
-1@@ -772,7 +772,7 @@ xfs_break_layouts( error =xfs_break_dax_layouts (inode, &retry);if (error || retry)break ; -/* fall through */ + fallthrough;case BREAK_WRITE : error =xfs_break_leased_layouts (inode, iolock, &retry);break ;fs/xfs/xfs_fsmap.c +1
-1@@ -100,7 +100,7 @@ xfs_fsmap_owner_to_rmap( dest->rm_owner =XFS_RMAP_OWN_COW ;break ;case XFS_FMR_OWN_DEFECTIVE :/* not implemented */ -/* fall through */ + fallthrough;default :return -EINVAL ; }fs/xfs/xfs_ioctl.c +1
-1@@ -557,7 +557,7 @@ xfs_ioc_attrmulti_one(case ATTR_OP_REMOVE : value =NULL ; *len =0 ; -/* fall through */ + fallthrough;case ATTR_OP_SET : error =mnt_want_write_file (parfilp);if (error)fs/xfs/xfs_trans_buf.c +1
-1@@ -310,7 +310,7 @@ xfs_trans_read_buf_map(default :if (tp && (tp->t_flags &XFS_TRANS_DIRTY ))xfs_force_shutdown (tp->t_mountp,SHUTDOWN_META_IO_ERROR ); -/* fall through */ + fallthrough;case -ENOMEM :case -EAGAIN :return error;Signature · 1 line
2.19.1