Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1139390ybh; Thu, 16 Jul 2020 04:22:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+0yLK07lnb3SlmgFCFntKYB8gnukhOP5CcWuNQz5qNvpmZcVmNrWs0P9A7L82mfY1mVgI X-Received: by 2002:a17:906:7115:: with SMTP id x21mr3177423ejj.86.1594898573812; Thu, 16 Jul 2020 04:22:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594898573; cv=none; d=google.com; s=arc-20160816; b=VLzM4egDfnIvT36bHPRZ+voXgXZJpkwI3+8a1Gn81GZw16vsCUmM8IbbqqQ272nI0O Xe7fhkr12DlIB15TZ/kpPVntLpF7cD/Umya9YyBAglvKNGTZJb5xi2foW4bHvoKiFxr7 30Ftw/tFJUC9uOoJHY6pVK0dldbA1CnAwzw1/fAaIoQcyYPwsV0W20fSTx+e09MIZhbp 2OqAbTaXOMM1H/Sv6IiU7lvfCX+r6Ay1/V6bgLRumnTCPXudPzl0owovnmncZbjZ4Qhq I5worgqFMUtPWOuU2DvNtWBWLQ1N/oFBZga8r3wqxY6G6C4y5SgmteoSWMqHwniuTnxA P86Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:to:subject:dkim-signature :dkim-signature; bh=JQc2JDpiN7HlnzfTn5ayQBEKrfkFWgs5fU4iTrIipus=; b=jyxgaHm7+gxvujG3Ja/pfP9KKhGRWVsK9dNN0F1btFnaJaEXEdmsGZRwjhUbzjAYSD k2aiVNZEDhrurRw5TtADGqLCz0I6giU9QUzD+oRJ04P8KVh5YigPGmVLSDE7GNGd9Hos rl262GMNFZpQVUASPWLoK6UbNQK7RW/dqxsi91M48k+qq0X3O5NkzJi7j/aOenOQ5brc nZd3gzshpyc47jvW815IzGPiXeSkubRHGKSVxhzYMthE0KhxUHE72QrB2uqusCPWdU6i S9Yom29F9K961nFQAfT6ZRVEVaIXkEZU3xT64MCKsOzvW5Y+d9O/9vMKK2/P/kr9Yqhl NClA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@g001.emailsrvr.com header.s=20190322-9u7zjiwi header.b="uTYEiy/m"; dkim=pass header.i=@mev.co.uk header.s=20190130-41we5z8j header.b=jtrVt2e+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l2si3374261edk.332.2020.07.16.04.22.31; Thu, 16 Jul 2020 04:22:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@g001.emailsrvr.com header.s=20190322-9u7zjiwi header.b="uTYEiy/m"; dkim=pass header.i=@mev.co.uk header.s=20190130-41we5z8j header.b=jtrVt2e+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728172AbgGPLVp (ORCPT + 99 others); Thu, 16 Jul 2020 07:21:45 -0400 Received: from smtp110.ord1c.emailsrvr.com ([108.166.43.110]:39541 "EHLO smtp110.ord1c.emailsrvr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726350AbgGPLVo (ORCPT ); Thu, 16 Jul 2020 07:21:44 -0400 X-Greylist: delayed 378 seconds by postgrey-1.27 at vger.kernel.org; Thu, 16 Jul 2020 07:21:43 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=g001.emailsrvr.com; s=20190322-9u7zjiwi; t=1594898124; bh=T/MnAJmGny+runRexgMA3yXRTrb0zwJfIt7Q+noAQk8=; h=Subject:To:From:Date:From; b=uTYEiy/mmmqcuzjD3fVqeBi8o79j2rvrww5/hxmrRXIpJ+Q9YkUGuOhTDJJgcTfuf 4ufLub1MyQsGqYc2nvmzqH0n2OBpUA7bjujniIPGnRjJOBcZ4ZbTnNWysFc5KlbKuY Fu2mmHIN6H8NiKwroIXG+Ui6MoCImSZyTTXSsxck= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mev.co.uk; s=20190130-41we5z8j; t=1594898124; bh=T/MnAJmGny+runRexgMA3yXRTrb0zwJfIt7Q+noAQk8=; h=Subject:To:From:Date:From; b=jtrVt2e+Rlvxe/SPvMWUSX7aTwU0xV+22MvOM6P+lx0whtFKK+xE+b+TgA8o1LOww jsP1UzHI059/TTJHNTJFnpvuq7AsiTpkHRDpVLSkd0si6kJsWJqceLan4SgyHFbVyz tFP40U+ly3c4JzkTUXTLYLTKajdagSGGSyR1i9Gw= X-Auth-ID: abbotti@mev.co.uk Received: by smtp22.relay.ord1c.emailsrvr.com (Authenticated sender: abbotti-AT-mev.co.uk) with ESMTPSA id 35550E04C2; Thu, 16 Jul 2020 07:15:23 -0400 (EDT) Subject: Re: [PATCH v2] staging: comedi: comedi_fops.c: added casts to get rid of sparse warnings To: B K Karthik , H Hartley Sweeten , Greg Kroah-Hartman , Al Viro , Xin Tan , Daniel Jordan , Divyansh Kamboj , Michel Lespinasse , Xiyu Yang , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org References: <20200715114824.rwqemojowcivbc3z@pesu-pes-edu> From: Ian Abbott Organization: MEV Ltd. Message-ID: Date: Thu, 16 Jul 2020 12:15:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200715114824.rwqemojowcivbc3z@pesu-pes-edu> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Classification-ID: 225dbd0f-4c33-42ef-bdb7-9d3d91d41638-1-1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/07/2020 12:48, B K Karthik wrote: > fixed sparse warnings by adding a cast in assignment from > void [noderef] __user * to unsigned int __force * > and a reverse cast in argument from > void [noderef] __user * to unsigned int __user * . Minor quibble: the reverse cast is actually from unsigned int * to unsigned int __user * . > > Signed-off-by: B K Karthik > --- > drivers/staging/comedi/comedi_fops.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c > index 3f70e5dfac39..9cdc1e8a022d 100644 > --- a/drivers/staging/comedi/comedi_fops.c > +++ b/drivers/staging/comedi/comedi_fops.c > @@ -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; > Reviewed-by: Ian Abbott -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Registered number: 02862268. Registered address: )=- -=( 15 West Park Road, Bramhall, STOCKPORT, SK7 3JZ, UK. )=-