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@xxxxxxxxx> Signed-off-by: Allison Collins <allison.henderson@xxxxxxxxxx> --- fs/xfs/libxfs/xfs_attr_leaf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.7.4