linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/2] xfs: Fix compiler warnings
@ 2020-07-28  4:32 Allison Collins
  2020-07-28  4:32 ` [PATCH v4 1/2] xfs: Fix compiler warning in xfs_attr_node_removename_setup Allison Collins
  2020-07-28  4:32 ` [PATCH v4 2/2] xfs: Fix compiler warning in xfs_attr_shortform_add Allison Collins
  0 siblings, 2 replies; 5+ messages in thread
From: Allison Collins @ 2020-07-28  4:32 UTC (permalink / raw)
  To: linux-xfs

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(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v4 1/2] xfs: Fix compiler warning in xfs_attr_node_removename_setup
  2020-07-28  4:32 [PATCH v4 0/2] xfs: Fix compiler warnings Allison Collins
@ 2020-07-28  4:32 ` Allison Collins
  2020-07-28 18:27   ` Eric Sandeen
  2020-07-28  4:32 ` [PATCH v4 2/2] xfs: Fix compiler warning in xfs_attr_shortform_add Allison Collins
  1 sibling, 1 reply; 5+ messages in thread
From: Allison Collins @ 2020-07-28  4:32 UTC (permalink / raw)
  To: linux-xfs

Fix compiler warning for variable 'blk' set but not used in
xfs_attr_node_removename_setup.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Allison Collins <allison.henderson@oracle.com>
---
 fs/xfs/libxfs/xfs_attr.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c
index d4583a0..e5ec9ed 100644
--- a/fs/xfs/libxfs/xfs_attr.c
+++ b/fs/xfs/libxfs/xfs_attr.c
@@ -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);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v4 2/2] xfs: Fix compiler warning in xfs_attr_shortform_add
  2020-07-28  4:32 [PATCH v4 0/2] xfs: Fix compiler warnings Allison Collins
  2020-07-28  4:32 ` [PATCH v4 1/2] xfs: Fix compiler warning in xfs_attr_node_removename_setup Allison Collins
@ 2020-07-28  4:32 ` Allison Collins
  2020-07-28 18:36   ` Eric Sandeen
  1 sibling, 1 reply; 5+ messages in thread
From: Allison Collins @ 2020-07-28  4:32 UTC (permalink / raw)
  To: linux-xfs

Fix compiler warning warning: variable 'error' set but not used in
xfs_attr_shortform_add.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Allison Collins <allison.henderson@oracle.com>
---
 fs/xfs/libxfs/xfs_attr_leaf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c
index ad7b351..8623c81 100644
--- a/fs/xfs/libxfs/xfs_attr_leaf.c
+++ b/fs/xfs/libxfs/xfs_attr_leaf.c
@@ -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);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v4 1/2] xfs: Fix compiler warning in xfs_attr_node_removename_setup
  2020-07-28  4:32 ` [PATCH v4 1/2] xfs: Fix compiler warning in xfs_attr_node_removename_setup Allison Collins
@ 2020-07-28 18:27   ` Eric Sandeen
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Sandeen @ 2020-07-28 18:27 UTC (permalink / raw)
  To: Allison Collins, linux-xfs

On 7/27/20 9:32 PM, Allison Collins wrote:
> Fix compiler warning for variable 'blk' set but not used in
> xfs_attr_node_removename_setup.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Allison Collins <allison.henderson@oracle.com>

Fixes: 534c7e150352 ("xfs: Add helper function xfs_attr_node_removename_setup")
Reviewed-by: Eric Sandeen <sandeen@redhat.com>

> ---
>  fs/xfs/libxfs/xfs_attr.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c
> index d4583a0..e5ec9ed 100644
> --- a/fs/xfs/libxfs/xfs_attr.c
> +++ b/fs/xfs/libxfs/xfs_attr.c
> @@ -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);
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v4 2/2] xfs: Fix compiler warning in xfs_attr_shortform_add
  2020-07-28  4:32 ` [PATCH v4 2/2] xfs: Fix compiler warning in xfs_attr_shortform_add Allison Collins
@ 2020-07-28 18:36   ` Eric Sandeen
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Sandeen @ 2020-07-28 18:36 UTC (permalink / raw)
  To: Allison Collins, linux-xfs

On 7/27/20 9:32 PM, Allison Collins wrote:
> Fix compiler warning warning: variable 'error' set but not used in
> xfs_attr_shortform_add.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Allison Collins <allison.henderson@oracle.com>

Fixes: cfe3d8821c6f ("xfs: Add xfs_has_attr and subroutines")
Reviewed-by: Eric Sandeen <sandeen@redhat.com>

> ---
>  fs/xfs/libxfs/xfs_attr_leaf.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c
> index ad7b351..8623c81 100644
> --- a/fs/xfs/libxfs/xfs_attr_leaf.c
> +++ b/fs/xfs/libxfs/xfs_attr_leaf.c
> @@ -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);
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-07-28 18:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-28  4:32 [PATCH v4 0/2] xfs: Fix compiler warnings Allison Collins
2020-07-28  4:32 ` [PATCH v4 1/2] xfs: Fix compiler warning in xfs_attr_node_removename_setup Allison Collins
2020-07-28 18:27   ` Eric Sandeen
2020-07-28  4:32 ` [PATCH v4 2/2] xfs: Fix compiler warning in xfs_attr_shortform_add Allison Collins
2020-07-28 18:36   ` Eric Sandeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).