[media] v4l2-ioctl.c: fix sparse __user-related warnings
authorHans Verkuil <hans.verkuil@cisco.com>
Mon, 17 Mar 2014 12:54:23 +0000 (09:54 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Wed, 16 Apr 2014 21:21:04 +0000 (18:21 -0300)
commitba2d35c14b6fc554547cf647bedb71cd9ead3cab
tree127e82f8f2227318c829880f7e4c8fdb2d1c1aa6
parent2dd477dbeb53937213d741db53110ac39ca245d1
[media] v4l2-ioctl.c: fix sparse __user-related warnings

Fix the use of __user in the check_array_args() prototype: instead of
using 'void * __user *' you should use 'void __user **' for sparse to
understand this correctly.

This also required the use of __force in the '*kernel_ptr = user_ptr'
assignment.

Also replace a wrong cast (void *) with the correct one (void **)
in check_array_args().

This fixes these sparse warnings:

drivers/media/v4l2-core/v4l2-ioctl.c:2284:35: warning: incorrect type in assignment (different address spaces)
drivers/media/v4l2-core/v4l2-ioctl.c:2301:35: warning: incorrect type in assignment (different address spaces)
drivers/media/v4l2-core/v4l2-ioctl.c:2319:35: warning: incorrect type in assignment (different address spaces)
drivers/media/v4l2-core/v4l2-ioctl.c:2386:57: warning: incorrect type in argument 4 (different address spaces)
drivers/media/v4l2-core/v4l2-ioctl.c:2420:29: warning: incorrect type in assignment (different address spaces)

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/v4l2-core/v4l2-ioctl.c