staging: i4l: icn: fix incorrect type of arguments
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Mon, 22 Aug 2016 16:34:58 +0000 (22:04 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Aug 2016 07:24:41 +0000 (09:24 +0200)
commit8a0b09d90574aef3bf6269f03a5c7a9d005474de
tree276cb6bdda8a3ab698a6d185461556d106e1cd92
parent1b30c21fd8abeb58e852c2a4dbaf6b4f45addb64
staging: i4l: icn: fix incorrect type of arguments

sparse was warning about incorrect type of argument:

drivers/staging/i4l/icn/icn.c:1048:49: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/i4l/icn/icn.c:1048:49: expected void const [noderef] <asn:1>*from
drivers/staging/i4l/icn/icn.c:1048:49: got unsigned char const [usertype] *buf
drivers/staging/i4l/icn/icn.c:1476:38: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/i4l/icn/icn.c:1476:38: expected unsigned char const [usertype] *buf
drivers/staging/i4l/icn/icn.c:1476:38: got unsigned char const [noderef] [usertype] <asn:1>*buf

The function icn_writecmd() was used to copy from userspace and also
from the kernelspace. Add another argument to the function to have two
separate pointers, one for the userspace and one for the kernelspace.
Based on the value of user as passed from the caller we use one of
the two pointers.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/i4l/icn/icn.c