From: Dave Chinner <david@fromorbit.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Brian Foster <bfoster@redhat.com>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH] xfs: fix unused variable warning in xfs_buf_item_unlock()
Date: Fri, 1 Sep 2017 07:52:09 +1000 [thread overview]
Message-ID: <20170831215209.GQ10621@dastard> (raw)
In-Reply-To: <20170831164107.GL3775@magnolia>
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@redhat.com>
>
> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
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@fromorbit.com
next prev parent reply other threads:[~2017-08-31 21:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-31 16:04 [PATCH] xfs: fix unused variable warning in xfs_buf_item_unlock() Brian Foster
2017-08-31 16:41 ` Darrick J. Wong
2017-08-31 21:52 ` Dave Chinner [this message]
2017-09-01 10:24 ` Brian Foster
2017-09-01 22:07 ` Dave Chinner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170831215209.GQ10621@dastard \
--to=david@fromorbit.com \
--cc=bfoster@redhat.com \
--cc=darrick.wong@oracle.com \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox