Commit ef85dffd authored by Mathieu Malaterre's avatar Mathieu Malaterre Committed by Michael Ellerman

powerpc: Avoid comparison of unsigned long >= 0 in __access_ok()

Rewrite function-like macro into regular static inline function to
avoid a warning during macro expansion.

Fix warning (treated as error in W=1):
./arch/powerpc/include/asm/uaccess.h:52:35: error: comparison of unsigned expression >= 0 is always true
   (((size) == 0) || (((size) - 1) <= ((segment).seg - (addr)))))
                                   ^
Suggested-by: default avatarSegher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: default avatarMathieu Malaterre <malat@debian.org>
Reviewed-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 603b8922
...@@ -47,9 +47,13 @@ ...@@ -47,9 +47,13 @@
#else #else
#define __access_ok(addr, size, segment) \ static inline int __access_ok(unsigned long addr, unsigned long size,
(((addr) <= (segment).seg) && \ mm_segment_t seg)
(((size) == 0) || (((size) - 1) <= ((segment).seg - (addr))))) {
if (addr > seg.seg)
return 0;
return (size == 0 || size - 1 <= seg.seg - addr);
}
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment