]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: fix variable state usage
authorDarrick J. Wong <djwong@kernel.org>
Fri, 3 Jun 2022 21:57:43 +0000 (14:57 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 28 Jun 2022 20:42:59 +0000 (13:42 -0700)
Source kernel commit: e387f3c8beb10f2f557d6fb1d31a0c0252a2b65d

The variable @args is fed to a tracepoint, and that's the only place
it's used.  This is fine for the kernel, but for userspace, tracepoints
are #define'd out of existence, which results in this warning on gcc
11.2:

xfs_attr.c: In function ‘xfs_attr_node_try_addname’:
xfs_attr.c:1440:42: warning: unused variable ‘args’ [-Wunused-variable]
1440 |         struct xfs_da_args              *args = attr->xattri_da_args;
|                                          ^~~~

Clean this up.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
libxfs/xfs_attr.c

index d2e28a27a4bb7d15340225c331891f2e0c5346b5..dba528e67d1bd9d8a653712b7e38af4ca4ffbf3e 100644 (file)
@@ -1439,12 +1439,11 @@ static int
 xfs_attr_node_try_addname(
        struct xfs_attr_intent          *attr)
 {
-       struct xfs_da_args              *args = attr->xattri_da_args;
        struct xfs_da_state             *state = attr->xattri_da_state;
        struct xfs_da_state_blk         *blk;
        int                             error;
 
-       trace_xfs_attr_node_addname(args);
+       trace_xfs_attr_node_addname(state->args);
 
        blk = &state->path.blk[state->path.active-1];
        ASSERT(blk->magic == XFS_ATTR_LEAF_MAGIC);