upstream: [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)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:55:11 +0000 (11:55 +0900)
commitb1e3a76ddd22843e30fcf845316f9c989a000d4a
tree67445931493b52b44a1ed4eea33dbf01ce2c43d3
parent53461cf80ca802a81264adfacfd44dc13f85f578
upstream: [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