x86: fix -Wsign-compare warnings in uaccess.h
PATCH 1/1 x86: fix -Wsign-compare warnings in uaccess.h
The casts are safe, since those conditions are only evaluated when sz >= 0.
Signed-off-by Роман Донченко <[email protected]>
--- arch/x86/include/asm/uaccess.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/include/asm/uaccess.h +2 -2
@@ -714,7 +714,7 @@ copy_from_user(void *to, const void __user *from, unsigned long n)* case, and do only runtime checking for non-constant sizes. */ -if (likely (sz <0 || sz >= n)) +if (likely (sz <0 || (unsigned )sz >= n)) n =_copy_from_user (to, from, n);else if (__builtin_constant_p (n))copy_from_user_overflow ();
@@ -732,7 +732,7 @@ copy_to_user(void __user *to, const void *from, unsigned long n)might_fault ();/* See the comment in copy_from_user() above. */ -if (likely (sz <0 || sz >= n)) +if (likely (sz <0 || (unsigned )sz >= n)) n =_copy_to_user (to, from, n);else if (__builtin_constant_p (n))copy_to_user_overflow ();
Signature · 1 line
2.3.2