Re: [PATCH] xfs: fix unused variable warning in xfs_buf_item_unlock()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 31, 2017 at 09:41:07AM -0700, Darrick J. Wong wrote:
> On Thu, Aug 31, 2017 at 12:04:58PM -0400, Brian Foster wrote:
> > The ordered variable generates an unused warning on !DEBUG builds.
> > Separate the initialization of the associated variables from the
> > declarations to quiet gcc.
> > 
> > Signed-off-by: Brian Foster <bfoster@xxxxxxxxxx>
> 
> Reviewed-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>

And merged before everyone in different timezones has had a chance
to comment. :(

I just built the latest for-next with CONFIG_XFS_DEBUG=n and there's
three set-but-unused warnings, one of which is introduced by this
patch.

fs/xfs/libxfs/xfs_inode_fork.c: In function ¿xfs_iext_realloc_indirect¿:
fs/xfs/libxfs/xfs_inode_fork.c:1503:7: error: variable ¿size¿ set but not used [-Werror=unused-but-set-variable]
  int  size;  /* current indirection array size */
       ^~~~

fs/xfs/xfs_buf_item.c: In function ¿xfs_buf_item_unlock¿:
fs/xfs/xfs_buf_item.c:573:9: error: variable ¿ordered¿ set but not used [-Werror=unused-but-set-variable]
  bool   ordered;
         ^~~~~~~

fs/xfs/xfs_log_recover.c: In function ¿xlog_recover_process_intents¿:
fs/xfs/xfs_log_recover.c:4830:13: error: variable ¿last_lsn¿ set but not used [-Werror=unused-but-set-variable]
  xfs_lsn_t  last_lsn;
             ^~~~~~~~

Yeah, maintainer habits die hard; I'm still patching fs/xfs/Makefile
in my build trees with this:

-ccflags-y += -I$(src)                  # needed for trace events
+ccflags-y += -I$(src) -Werror -Wunused-but-set-variable

Which catches stupid problems like this that will the userspace
libxfs build will trip over when the next merge occurs.

Playing games with declaration/initialisation order to avoid
warnigns just doesn't work.

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux