Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Fix access_ok() fallout for sparc32 and powerpc

These two architectures actually had an intentional use of the 'type'
argument to access_ok() just to avoid warnings.

I had actually noticed the powerpc one, but forgot to then fix it up.
And I missed the sparc32 case entirely.

This is hopefully all of it.

Reported-by: Mathieu Malaterre <malat@debian.org>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Fixes: 96d4f267e40f ("Remove 'type' argument from access_ok() function")
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

+2 -3
+1 -1
arch/powerpc/include/asm/uaccess.h
··· 63 63 #endif 64 64 65 65 #define access_ok(addr, size) \ 66 - (__chk_user_ptr(addr), (void)(type), \ 66 + (__chk_user_ptr(addr), \ 67 67 __access_ok((__force unsigned long)(addr), (size), get_fs())) 68 68 69 69 /*
+1 -2
arch/sparc/include/asm/uaccess_32.h
··· 39 39 #define __user_ok(addr, size) ({ (void)(size); (addr) < STACK_TOP; }) 40 40 #define __kernel_ok (uaccess_kernel()) 41 41 #define __access_ok(addr, size) (__user_ok((addr) & get_fs().seg, (size))) 42 - #define access_ok(addr, size) \ 43 - ({ (void)(type); __access_ok((unsigned long)(addr), size); }) 42 + #define access_ok(addr, size) __access_ok((unsigned long)(addr), size) 44 43 45 44 /* 46 45 * The exception table consists of pairs of addresses: the first is the