public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: "Darrick J. Wong" <djwong@kernel.org>,
	linux-xfs@vger.kernel.org, Brian Foster <bfoster@redhat.com>,
	Allison Henderson <allison.henderson@oracle.com>
Cc: Arnd Bergmann <arnd@arndb.de>, Dave Chinner <dchinner@redhat.com>,
	Gao Xiang <hsiangkao@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] xfs: fix unused variable warning
Date: Thu,  4 Feb 2021 17:03:44 +0100	[thread overview]
Message-ID: <20210204160427.2303504-1-arnd@kernel.org> (raw)

From: Arnd Bergmann <arnd@arndb.de>

When debugging is disabled, the ASSERT() is left out and
the 'log' variable becomes unused:

fs/xfs/xfs_log.c:1111:16: error: unused variable 'log' [-Werror,-Wunused-variable]

Remove the variable declaration and open-code it inside
of the assertion.

Fixes: 303591a0a947 ("xfs: cover the log during log quiesce")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/xfs/xfs_log.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 58699881c100..d8b814227734 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -1108,12 +1108,11 @@ static int
 xfs_log_cover(
 	struct xfs_mount	*mp)
 {
-	struct xlog		*log = mp->m_log;
 	int			error = 0;
 	bool			need_covered;
 
-	ASSERT((xlog_cil_empty(log) && xlog_iclogs_empty(log) &&
-	        !xfs_ail_min_lsn(log->l_ailp)) ||
+	ASSERT((xlog_cil_empty(mp->m_log) && xlog_iclogs_empty(mp->m_log) &&
+	        !xfs_ail_min_lsn(mp->m_log->l_ailp)) ||
 	       XFS_FORCED_SHUTDOWN(mp));
 
 	if (!xfs_log_writable(mp))
-- 
2.29.2


             reply	other threads:[~2021-02-04 16:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04 16:03 Arnd Bergmann [this message]
2021-02-04 18:07 ` [PATCH] xfs: fix unused variable warning Brian Foster
  -- strict thread matches above, loose matches on Subject: below --
2011-10-06  4:57 Dave Chinner
2011-10-06 11:24 ` Alex Elder
2011-10-06 21:56   ` 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=20210204160427.2303504-1-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=allison.henderson@oracle.com \
    --cc=arnd@arndb.de \
    --cc=bfoster@redhat.com \
    --cc=dchinner@redhat.com \
    --cc=djwong@kernel.org \
    --cc=hsiangkao@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --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