]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mtd: Fix warning in access_ok() parameter passing
authorGeert Uytterhoeven <geert@linux-m68k.org>
Thu, 1 May 2014 18:40:54 +0000 (20:40 +0200)
committerBrian Norris <computersforpeace@gmail.com>
Tue, 20 May 2014 23:35:29 +0000 (16:35 -0700)
commitf62cde49f9f02d6c205ab310b8fd4a29ddc49329
tree0f0e1efecfba18539eb0490d21d48bb746ace83c
parentf306e8c3b667632952f1a4a74ffb910bbc06255f
mtd: Fix warning in access_ok() parameter passing

On m68k, where access_ok() doesn't cast the address parameter:

drivers/mtd/mtdchar.c: In function 'mtdchar_write_ioctl':
drivers/mtd/mtdchar.c:575:4: warning: passing argument 2 of 'access_ok' makes pointer from integer without a cast [enabled by default]
arch/m68k/include/asm/uaccess_mm.h:17:90: note: expected 'const void *' but argument is of type '__u64'
drivers/mtd/mtdchar.c:576:4: warning: passing argument 2 of 'access_ok' makes pointer from integer without a cast [enabled by default]
arch/m68k/include/asm/uaccess_mm.h:17:90: note: expected 'const void *' but argument is of type '__u64'

The address parameter of access_ok() is really a userspace pointer.
On most architectures, access_ok() is a macro that casts the address
parameter, hiding issues in its users.

Move around and use the existing usr_data and usr_oob temporary variables
to kill the warnings. Add a few "consts", and make more use of the
temporaries while we're at it.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/mtdchar.c