powerpc: Avoid comparison of unsigned long >= 0 in __access_ok()
authorMathieu Malaterre <malat@debian.org>
Fri, 2 Mar 2018 19:50:51 +0000 (20:50 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
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 <segher@kernel.crashing.org>
Signed-off-by: Mathieu Malaterre <malat@debian.org>
Reviewed-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/uaccess.h