]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
staging: comedi: comedi_fops.c: added casts to get rid of sparse warnings
authorB K Karthik <bkkarthik@pesu.pes.edu>
Fri, 17 Jul 2020 10:30:31 +0000 (06:30 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Jul 2020 14:20:37 +0000 (16:20 +0200)
fixed sparse warnings by adding a cast in assignment from
void [noderef] __user * to unsigned int __force *
and a reverse cast in argument from
unsigned int * to  unsigned int __user * .

Signed-off-by: B K Karthik <karthik.bk2000@live.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Link: https://lore.kernel.org/r/20200717103031.3mfnlvqo3waolsee@pesu-pes-edu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/comedi_fops.c

index 3f70e5dfac394f0cb9794aad8b5800e2f1161883..9cdc1e8a022d705c615c9affb0f8c69bd7246dab 100644 (file)
@@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct comedi_cmd *cmd,
        cmd->scan_end_arg = v32.scan_end_arg;
        cmd->stop_src = v32.stop_src;
        cmd->stop_arg = v32.stop_arg;
-       cmd->chanlist = compat_ptr(v32.chanlist);
+       cmd->chanlist = (unsigned int __force *)compat_ptr(v32.chanlist);
        cmd->chanlist_len = v32.chanlist_len;
        cmd->data = compat_ptr(v32.data);
        cmd->data_len = v32.data_len;
@@ -2983,7 +2983,7 @@ static int put_compat_cmd(struct comedi32_cmd_struct __user *cmd32,
        v32.stop_src = cmd->stop_src;
        v32.stop_arg = cmd->stop_arg;
        /* Assume chanlist pointer is unchanged. */
-       v32.chanlist = ptr_to_compat(cmd->chanlist);
+       v32.chanlist = ptr_to_compat((unsigned int __user *)cmd->chanlist);
        v32.chanlist_len = cmd->chanlist_len;
        v32.data = ptr_to_compat(cmd->data);
        v32.data_len = cmd->data_len;