Skip to content

Commit 90b75db

Browse files
Dave Chinnertorvalds
authored andcommitted
fault_in_multipages_readable() throws set-but-unused error
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 <[email protected]> Cc: Al Viro <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 38e0885 commit 90b75db

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

include/linux/pagemap.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,7 @@ static inline int fault_in_multipages_readable(const char __user *uaddr,
620620
return __get_user(c, end);
621621
}
622622

623+
(void)c;
623624
return 0;
624625
}
625626

0 commit comments

Comments
 (0)