All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: xfs-oss <xfs@oss.sgi.com>
Subject: [PATCH] xfsprogs: silence unused var warnings
Date: Thu, 14 May 2015 17:17:54 -0500	[thread overview]
Message-ID: <55551F12.1070308@redhat.com> (raw)

This takes 2 different approaches, just following similar code
that already exists.  It'll probably make Coverity flag
the pointless assignments, unfortunately.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

Note, this is for the libxfs-4 branch

diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h
index 1b4ac64..c871d53 100644
--- a/libxfs/libxfs_priv.h
+++ b/libxfs/libxfs_priv.h
@@ -150,9 +150,9 @@ enum ce { CE_DEBUG, CE_CONT, CE_NOTE, CE_WARN, CE_ALERT, CE_PANIC };
 #define XFS_TRANS_UNRESERVE_QUOTA_NBLKS(mp,tp,ip,nblks,ninos,fl)	0
 #define XFS_TEST_ERROR(expr,a,b,c)	( expr )
 #define XFS_WANT_CORRUPTED_GOTO(mp, expr, l)	\
-		{ if (!(expr)) { error = EFSCORRUPTED; goto l; } }
+		{ (mp) = (mp); if (!(expr)) { error = EFSCORRUPTED; goto l; } }
 #define XFS_WANT_CORRUPTED_RETURN(mp, expr)	\
-		{ if (!(expr)) { return EFSCORRUPTED; } }
+		{ (mp) = (mp); if (!(expr)) { return EFSCORRUPTED; } }
 
 #ifdef __GNUC__
 #define __return_address	__builtin_return_address(0)
@@ -344,7 +344,11 @@ roundup_64(__uint64_t x, __uint32_t y)
 
 /* space allocation */
 #define xfs_extent_busy_reuse(mp,ag,bno,len,user)	((void) 0)
-#define xfs_extent_busy_insert(tp,ag,bno,len,flags)	((void) 0)
+/* avoid unused variable warning */
+#define xfs_extent_busy_insert(tp,ag,bno,len,flags)({ 	\
+	xfs_agnumber_t __foo = ag; 			\
+	__foo = 0;					\
+})
 #define xfs_extent_busy_trim(args,fbno,flen,bno,len) \
 do { \
 	*(bno) = (fbno); \

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

             reply	other threads:[~2015-05-14 22:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14 22:17 Eric Sandeen [this message]
2015-06-05  2:14 ` [PATCH] xfsprogs: silence unused var warnings 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=55551F12.1070308@redhat.com \
    --to=sandeen@redhat.com \
    --cc=xfs@oss.sgi.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.