Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1847934ybh; Fri, 17 Jul 2020 02:50:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtohQSqxhCGOuQwvxmMYQ4u7dGWYs+VkVzdToz5IxGhEYVPftv/nMhHxVk1DlCL0ZRo+Wq X-Received: by 2002:a17:906:b2c8:: with SMTP id cf8mr7900298ejb.132.1594979437299; Fri, 17 Jul 2020 02:50:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594979437; cv=none; d=google.com; s=arc-20160816; b=1Jd/gxJSjgTeqXx6nTSqby/YC7HIPoZyT5OEhDxLeZ+UgtmQGRPHLiPZ0DJhimKrsG iZbxm0VJNqIIWBo6HJXtRfs0aD2KYu3b7ipHZ1dzQJMOAtBZfIRmMXUsVK5Wp7R8L16y bWGm8O4dOa8P+n3ONTbkLz9hmlOQl+V34NV19K+uC0LSi5arpc66jLP0FZDR1grHwcPQ yf2bDNFIP2SYvIEvOJ+mA45pRUvxI1pCi6toPklR++APpCIrmT7HKjnF9Jo0ghckbqoA u5pcTGyswGk4M6bu5fXLlJ47WnE8rPzYhWAzjKBSPE3VenPLkR+YbOnKYMQzmtZToiQ1 /F0g== 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=XBwh+B6lU0hNdpAqhfuqVMsHHs79vodvdRAmxEPWsEA=; b=k8v9xoM4z420y0moHPJpXrE4OGJcTTx15Uur8mAjI89KHCZMOYCMxpW5u0dN//+QKY D4+cE8jqNGzsmgiP66AX4T8S4Wyov0R5Lifzoyq4CPm5UU+u73B5lvTq99wV/PnKWdje TZAeRB0q/9biESQwgqA0DNLYXpIkdKiw3cr0x5KY92GLsHO7m8SXlIjwBTXCYx4ntq4o nnl0nFrGNYtCnASH3ecBdeotxFIV0jsE+XIgXUBjVYVsLBRGjFXBYSHAgMgUmfzE0aiU 356fiimSOu2FRbsxT3FhoEuaSIsFR7agJ3If8QYHvl4QRu8VtRY9EVdmIBVSQ8Y+4g+N GzuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@g001.emailsrvr.com header.s=20190322-9u7zjiwi header.b=y1xYn0NF; dkim=pass header.i=@mev.co.uk header.s=20190130-41we5z8j header.b="NBq/h2H4"; 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 v16si5052287edr.93.2020.07.17.02.50.14; Fri, 17 Jul 2020 02:50:37 -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=y1xYn0NF; dkim=pass header.i=@mev.co.uk header.s=20190130-41we5z8j header.b="NBq/h2H4"; 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 S1726046AbgGQJr7 (ORCPT + 99 others); Fri, 17 Jul 2020 05:47:59 -0400 Received: from smtp89.iad3b.emailsrvr.com ([146.20.161.89]:48824 "EHLO smtp89.iad3b.emailsrvr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725912AbgGQJr6 (ORCPT ); Fri, 17 Jul 2020 05:47:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=g001.emailsrvr.com; s=20190322-9u7zjiwi; t=1594979277; bh=WXkjnIO94DrrmTRmi3QBp3/Lh0Il+Vz6algDOKksuBc=; h=Subject:To:From:Date:From; b=y1xYn0NFBkJeaNCBBUotm4z1kwx472qTs/IhTRVjU7TFEv48y/kqYkL3H37YGVaT4 zbskUISJ6TKIGxDHnyI4ULmYkUVd0lLAcqZj9gxoU8NSMhT6ABn0bAtKjVMA3JO8Y6 GqXRzIN4+tuIw4w8H5STbEhE+aRCKhzfYXwOS0mo= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mev.co.uk; s=20190130-41we5z8j; t=1594979277; bh=WXkjnIO94DrrmTRmi3QBp3/Lh0Il+Vz6algDOKksuBc=; h=Subject:To:From:Date:From; b=NBq/h2H4SwIN245gkZoKtTMMwrEhv5o+IknLSfP7s4Pk4LEznd7I8a8vF1eTfkzLS I40kzzTQ/DZoZwgMgLthHxn9LXC5nNPyzf1sfH6Xifd2sFZnDk3l7diaA2jEKvCHkD ijsxkJYza/b4tYhQVeu/yHyAkxnWGN6TSqy3Z4Eg= X-Auth-ID: abbotti@mev.co.uk Received: by smtp4.relay.iad3b.emailsrvr.com (Authenticated sender: abbotti-AT-mev.co.uk) with ESMTPSA id 5886420080; Fri, 17 Jul 2020 05:47:56 -0400 (EDT) Subject: Re: [PATCH v4] 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 , Vlastimil Babka , Xiyu Yang , Michel Lespinasse , Divyansh Kamboj , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org References: <20200716152548.mzau4zhurwkzp5p6@pesu-pes-edu> From: Ian Abbott Organization: MEV Ltd. Message-ID: <8afee168-b65c-dafe-59f6-32d1c59d87dc@mev.co.uk> Date: Fri, 17 Jul 2020 10:47:55 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200716152548.mzau4zhurwkzp5p6@pesu-pes-edu> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Classification-ID: 2d6a9683-da48-406f-a750-e911abcb7c7b-1-1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16/07/2020 16:25, 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 > unsigned int * to unsigned int __user * . > > v1 -> v2: > - Add a reverse cast in argument > v2 -> v3: > - Change commit description as suggested by Ian Abott > v3 -> v4: > - Add versioning information in commit description For future reference, the patch change history should go below the "---" divider line below where git will ignore it so that it does not appear in the final commit description. Otherwise, the committer would need to edit it out manually. > > 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; > Still looks good. 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. )=-