powerpc: Avoid comparison of unsigned long >= 0 in __access_ok()
authorMathieu Malaterre <[email protected]>
Fri, 2 Mar 2018 19:50:51 +0000 (20:50 +0100)
committerMichael Ellerman <[email protected]>
Tue, 13 Mar 2018 04:50:41 +0000 (15:50 +1100)
commitef85dffd4251ff6c23056651f6f83bdce83cd1cf
tree831767727f20622f70b91eeab2966bb9e77284de
parent603b892200e653dd7e86a0e4a315561534d97441
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: Segher Boessenkool <[email protected]>
Signed-off-by: Mathieu Malaterre <[email protected]>
Reviewed-by: Christophe Leroy <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
arch/powerpc/include/asm/uaccess.h