mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: linux-kernel@vger.kernel.org
Cc: viro@zeniv.linux.org.uk, torvalds@linux-foundation.org
Subject: [PATCH] [4.8-rc7, regression] fault_in_multipages_readable() throws set-but-unused error
Date: Mon, 26 Sep 2016 09:57:33 +1000	[thread overview]
Message-ID: <1474847853-9668-1-git-send-email-david@fromorbit.com> (raw)

From: Dave Chinner <dchinner@redhat.com>

When building XFS with -Werror, it now fails with:

./include/linux/pagemap.h: In function ¿fault_in_multipages_readable¿:
./include/linux/pagemap.h:602:16: error: variable ¿c¿ set but not used [-Werror=unused-but-set-variable]
  volatile char c;
                ^

This is a regression caused by commit e23d415 ("fix
fault_in_multipages_...() on architectures with no-op access_ok()").
Fix it by re-adding the "(void)c" trick taht was previously used to
make the compiler think the variable is used.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 include/linux/pagemap.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 7e3d537..01e8443 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -620,6 +620,7 @@ static inline int fault_in_multipages_readable(const char __user *uaddr,
 		return __get_user(c, end);
 	}
 
+	(void)c;
 	return 0;
 }
 
-- 
2.8.0.rc3

             reply	other threads:[~2016-09-25 23:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-25 23:57 Dave Chinner [this message]
2016-09-26  1:21 ` Linus Torvalds
2016-09-26  2:25   ` Dave Chinner
2016-09-26  3:06     ` Linus Torvalds
2016-09-26 11:24       ` Stephen Rothwell

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=1474847853-9668-1-git-send-email-david@fromorbit.com \
    --to=david@fromorbit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /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

all inboxes | Powered by JetHome®