• Christophe Leroy's avatar
    powerpc/uaccess: fix warning/error with access_ok() · 05a4ab82
    Christophe Leroy authored
    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: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    05a4ab82
uaccess.h 10.8 KB