xfs: Fix compiler warnings
v4 cover xfs: Fix compiler warnings
Some variables added in the delayed attr series were only used in ASSERT checks, and caused some compiler warnings. This set fixes these warnings by removing the convenience variable.
Allison Collins (2):
xfs: Fix compiler warning in xfs_attr_node_removename_setup
xfs: Fix compiler warning in xfs_attr_shortform_add
fs/xfs/libxfs/xfs_attr.c | 7 +++---- fs/xfs/libxfs/xfs_attr_leaf.c | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-)
Signature · 1 line
2.7.4
PATCH v4 1/2 xfs: Fix compiler warning in xfs_attr_node_removename_setup
Fix compiler warning for variable 'blk' set but not used in xfs_attr_node_removename_setup.
--- fs/xfs/libxfs/xfs_attr.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
fs/xfs/libxfs/xfs_attr.c +3 -4
@@ -1174,15 +1174,14 @@ int xfs_attr_node_removename_setup( struct xfs_da_state **state) {int error; -struct xfs_da_state_blk *blk; error =xfs_attr_node_hasname (args, state);if (error != -EEXIST )return error; - blk = &(*state)->path.blk[(*state)->path.active -1 ]; -ASSERT (blk->bp !=NULL ); -ASSERT (blk->magic ==XFS_ATTR_LEAF_MAGIC ); +ASSERT ((*state)->path.blk[(*state)->path.active -1 ].bp !=NULL ); +ASSERT ((*state)->path.blk[(*state)->path.active -1 ].magic == +XFS_ATTR_LEAF_MAGIC );if (args->rmtblkno >0 ) { error =xfs_attr_leaf_mark_incomplete (args, *state);
Signature · 1 line
2.7.4
Re: [PATCH v4 1/2] xfs: Fix compiler warning in xfs_attr_node_removename_setup
Quoted 5 lines · Allison Collins
Fix compiler warning for variable 'blk' set but not used in
xfs_attr_node_removename_setup.Reported-by kernel test robot <[email protected]>Signed-off-by Allison Collins <[email protected]>
Quoted 28 lines
--- fs/xfs/libxfs/xfs_attr.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)fs/xfs/libxfs/xfs_attr.c +3
-4@@ -1174,15 +1174,14 @@ int xfs_attr_node_removename_setup( struct xfs_da_state **state) {int error; -struct xfs_da_state_blk *blk; error =xfs_attr_node_hasname (args, state);if (error != -EEXIST )return error; - blk = &(*state)->path.blk[(*state)->path.active -1 ]; -ASSERT (blk->bp !=NULL ); -ASSERT (blk->magic ==XFS_ATTR_LEAF_MAGIC ); +ASSERT ((*state)->path.blk[(*state)->path.active -1 ].bp !=NULL ); +ASSERT ((*state)->path.blk[(*state)->path.active -1 ].magic == +XFS_ATTR_LEAF_MAGIC );if (args->rmtblkno >0 ) { error =xfs_attr_leaf_mark_incomplete (args, *state);
PATCH v4 2/2 xfs: Fix compiler warning in xfs_attr_shortform_add
In reply to Allison CollinsFix compiler warning warning: variable 'error' set but not used in xfs_attr_shortform_add.
--- fs/xfs/libxfs/xfs_attr_leaf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
fs/xfs/libxfs/xfs_attr_leaf.c +3 -3
@@ -715,7 +715,7 @@ xfs_attr_shortform_add( {struct xfs_attr_shortform *sf;struct xfs_attr_sf_entry *sfe; -int offset, size, error; +int offset, size;struct xfs_mount *mp;struct xfs_inode *dp;struct xfs_ifork *ifp;
@@ -729,8 +729,8 @@ xfs_attr_shortform_add( ifp = dp->i_afp;ASSERT (ifp->if_flags &XFS_IFINLINE ); sf = (xfs_attr_shortform_t *)ifp->if_u1.if_data; - error =xfs_attr_sf_findname (args, &sfe,NULL ); -ASSERT (error != -EEXIST ); +if (xfs_attr_sf_findname (args, &sfe,NULL ) == -EEXIST ) +ASSERT (0 ); offset = (char *)sfe - (char *)sf; size =XFS_ATTR_SF_ENTSIZE_BYNAME (args->namelen, args->valuelen);
Signature · 1 line
2.7.4
Re: [PATCH v4 2/2] xfs: Fix compiler warning in xfs_attr_shortform_add
Quoted 5 lines · Allison Collins
Fix compiler warning warning: variable 'error' set but not used in
xfs_attr_shortform_add.Reported-by kernel test robot <[email protected]>Signed-off-by Allison Collins <[email protected]>
Quoted 29 lines
--- fs/xfs/libxfs/xfs_attr_leaf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)fs/xfs/libxfs/xfs_attr_leaf.c +3
-3@@ -715,7 +715,7 @@ xfs_attr_shortform_add( {struct xfs_attr_shortform *sf;struct xfs_attr_sf_entry *sfe; -int offset, size, error; +int offset, size;struct xfs_mount *mp;struct xfs_inode *dp;struct xfs_ifork *ifp;@@ -729,8 +729,8 @@ xfs_attr_shortform_add( ifp = dp->i_afp;ASSERT (ifp->if_flags &XFS_IFINLINE ); sf = (xfs_attr_shortform_t *)ifp->if_u1.if_data; - error =xfs_attr_sf_findname (args, &sfe,NULL ); -ASSERT (error != -EEXIST ); +if (xfs_attr_sf_findname (args, &sfe,NULL ) == -EEXIST ) +ASSERT (0 ); offset = (char *)sfe - (char *)sf; size =XFS_ATTR_SF_ENTSIZE_BYNAME (args->namelen, args->valuelen);