mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
powerpc/uaccess: fix warning/error with access_ok()
[ Upstream commit 05a4ab8239 ]
With the following piece of code, the following compilation warning
is encountered:
if (_IOC_DIR(ioc) != _IOC_NONE) {
int verify = _IOC_DIR(ioc) & _IOC_READ ? VERIFY_WRITE : VERIFY_READ;
if (!access_ok(verify, ioarg, _IOC_SIZE(ioc))) {
drivers/platform/test/dev.c: In function 'my_ioctl':
drivers/platform/test/dev.c:219:7: warning: unused variable 'verify' [-Wunused-variable]
int verify = _IOC_DIR(ioc) & _IOC_READ ? VERIFY_WRITE : VERIFY_READ;
This patch fixes it by referencing 'type' in the macro allthough
doing nothing with it.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
04fed9d3e7
commit
e93ea07f48
@@ -54,7 +54,7 @@
|
||||
#endif
|
||||
|
||||
#define access_ok(type, addr, size) \
|
||||
(__chk_user_ptr(addr), \
|
||||
(__chk_user_ptr(addr), (void)(type), \
|
||||
__access_ok((__force unsigned long)(addr), (size), get_fs()))
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user