staging: comedi: fix cast warning in comedi_compat32.c
authorGeliang Tang <geliangtang@163.com>
Mon, 22 Jun 2015 15:33:42 +0000 (23:33 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Jul 2015 01:21:15 +0000 (18:21 -0700)
This patch fixes the following sparse warning:

drivers/staging/comedi/comedi_compat32.c:205:16: warning: cast removes
address space of expression

Signed-off-by: Geliang Tang <geliangtang@163.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/comedi_compat32.c

index 25848244c4b129ca521370523fe064e8430bf8d3..f356386d833a1fe80c83b9a492634d295991688a 100644 (file)
@@ -202,7 +202,8 @@ static int get_compat_cmd(struct comedi_cmd __user *cmd,
        err |= __get_user(temp.uint, &cmd32->stop_arg);
        err |= __put_user(temp.uint, &cmd->stop_arg);
        err |= __get_user(temp.uptr, &cmd32->chanlist);
-       err |= __put_user(compat_ptr(temp.uptr), &cmd->chanlist);
+       err |= __put_user((unsigned int __force *)compat_ptr(temp.uptr),
+                       &cmd->chanlist);
        err |= __get_user(temp.uint, &cmd32->chanlist_len);
        err |= __put_user(temp.uint, &cmd->chanlist_len);
        err |= __get_user(temp.uptr, &cmd32->data);