diff mbox series

[v2,2/2] xfs: Fix compiler warning in xfs_attr_shortform_add

Message ID 20200727022608.18535-3-allison.henderson@oracle.com (mailing list archive)
State Superseded
Headers show
Series xfs: Fix compiler warnings | expand

Commit Message

Allison Henderson July 27, 2020, 2:26 a.m. UTC
Fix compiler warning warning: variable 'error' set but not used in
xfs_attr_shortform_add. error is used only in an ASSERT so only declare
error when DEBUG is set.

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

Patch

diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c
index ad7b351..db985b8 100644
--- a/fs/xfs/libxfs/xfs_attr_leaf.c
+++ b/fs/xfs/libxfs/xfs_attr_leaf.c
@@ -715,7 +715,10 @@  xfs_attr_shortform_add(
 {
 	struct xfs_attr_shortform	*sf;
 	struct xfs_attr_sf_entry	*sfe;
-	int				offset, size, error;
+	int				offset, size;
+#if DEBUG
+	int				error;
+#endif
 	struct xfs_mount		*mp;
 	struct xfs_inode		*dp;
 	struct xfs_ifork		*ifp;