Skip to content

Commit

Permalink
fault_in_multipages_readable() throws set-but-unused error
Browse files Browse the repository at this point in the history
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>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Dave Chinner authored and torvalds committed Sep 26, 2016
1 parent 38e0885 commit 90b75db
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions include/linux/pagemap.h
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ static inline int fault_in_multipages_readable(const char __user *uaddr,
return __get_user(c, end);
}

(void)c;
return 0;
}

Expand Down

0 comments on commit 90b75db

Please sign in to comment.