Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp403966ybh; Wed, 15 Jul 2020 05:14:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxA8icAg9b21B5JQb2DQJGTAxXtMsaI53wF8t/hSXRa2W1LGWQR6WTiOr54Lvi6+LKct2PX X-Received: by 2002:a17:906:6dd7:: with SMTP id j23mr8668767ejt.529.1594815258381; Wed, 15 Jul 2020 05:14:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594815258; cv=none; d=google.com; s=arc-20160816; b=ByQSCq0p9AoU/9NkQft4SROPs4F6sJ3gk5ClDGAAMh2oczq6XMpAFEf6etObNhenTt qG8R0itRu2T288QZQZ/9U1qSjlbLsYnFnpd/H7fMDNJoCy0znnECQCSna1LQQ00nhoeo LUCDUb24KZaLKMr1ggM199S+GskGdWw0++r5eQFE9eJ3XWoA5IboIgLCPoYHVYd9QUZS m9AyrkTR+7/r+mx4xdIoqE5kC4e9xNOpsklsBsGeTp+wDdrRVY3NSKcBD+dg3Hhr86wk OxFwYxhUmZFZxjuTBhvzF6RLP/+wF2n0fFIRk7A7KiCkcynu/8kw9TZukGFx9R2r6+O5 eu0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=NyvuHuxxjvWixAHxdaLAwZ6ZtVOaOESx6JTIlYQ1UFI=; b=oL4zXWNpYoPtOm5eFAc42FtNIuW4KzX8vK51DZwUARh0n0++L3nsmm0ZkGDlTN1XlH QsjbwbHqj8b/2VqcnD6aHcqxtP2SdjaPMhYmffcdh25aGteY1XXXlEcRj/hMfmWf98ph Rl5tEiVHwvQOfnfj0QuvPyDkh6UjXygqWDwlN7meEMkMuWth2gdIq6KFjGZKKncIhz++ 8DUIb3PZE/hyu2wisaB/c43+YJarC8xDn+7wzTia2e96j0TufFNnmhN1GNCaSHcLGSE3 P+a9ZQXvS8yU3EWszLbXV9AbWuJwPk1zFwIVNp2OgJUsBcaXTholwDouslzUMElocGaW KDpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pesu-pes-edu.20150623.gappssmtp.com header.s=20150623 header.b=Jhuq7dRp; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=pes.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h16si1175275ejx.446.2020.07.15.05.13.54; Wed, 15 Jul 2020 05:14:18 -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=@pesu-pes-edu.20150623.gappssmtp.com header.s=20150623 header.b=Jhuq7dRp; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=pes.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729138AbgGOLfI (ORCPT + 99 others); Wed, 15 Jul 2020 07:35:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728970AbgGOLfH (ORCPT ); Wed, 15 Jul 2020 07:35:07 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA519C061755 for ; Wed, 15 Jul 2020 04:35:06 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id z24so2167279ljn.8 for ; Wed, 15 Jul 2020 04:35:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pesu-pes-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NyvuHuxxjvWixAHxdaLAwZ6ZtVOaOESx6JTIlYQ1UFI=; b=Jhuq7dRptRZ5adddt0e2fWxQLeRIVq1FjdGY4ntX0JfABPLOpttj04c173B1lrBZ4g 8uXkwo6UzwFqC5hkEEDc2a9n1T8mJMGUYndW26RFbW6Pg2itghKVqj/cXxheuqv3WuqN iQgp70k8raExTKpMc6nuIxP+yg9EbrRXbvf/YYpT6b1XPq3F8/KhTWzGaQekYAN5yzw5 GJrP5cHIwNuQeKV7CzsgoOqSfcKTqfvRpPrepD5YhJR5jlCFoDd09AaqahvS5Zp5BuTZ XVyrf6rU2CTqnb0SApTvqQKPcc5rigrHbpyVuTnDI7tvxBdfySGEuT40Mv2PYai+B1hq QX9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NyvuHuxxjvWixAHxdaLAwZ6ZtVOaOESx6JTIlYQ1UFI=; b=VyZrXmPUiU1w3GJW1vCbjnqW2QJ5uFfb02HEU6i8ZsXjPfHUZoLaoqLltB9zPwl+4t xsY6mmiBj7wiKNoKL5BEM1eSaeKi8KPN2VwE8WaB43IBruBQXwmyZhp++ArzYswQn+bI ieigMFFf8p6E9tq4cctZTk12y/abTu5Ri+6ZnzGdk37nWedJssOIsUTZ5PULhdtaTncy QKv3yE0n/KGEZBtkqpxi1ETVFCX7TpUie1Iq2PuwBOgO8QwGKD/biNWk3pSPw7sVtbfJ apEI5HMvv9XY1jqk4p36RWNjDB4+Kkaj7klBhCX4akc2UE26FPQAcDcO6DFSVepoz3IF VkUg== X-Gm-Message-State: AOAM533nkMqcDPMUmyFFZtb17oEY3mVXX2q6BMa1rC2IXZoYGRNDbBov LaAyZh8wX0sT91FYjBPgZJBuZDENX1UtkYi7Kq/AnA== X-Received: by 2002:a2e:b4ed:: with SMTP id s13mr4678829ljm.296.1594812905302; Wed, 15 Jul 2020 04:35:05 -0700 (PDT) MIME-Version: 1.0 References: <20200715044813.fww3regsgsbgyp7b@pesu-pes-edu> <4aa4d949-7ef9-ccfe-bf5c-11a380c8f542@mev.co.uk> In-Reply-To: <4aa4d949-7ef9-ccfe-bf5c-11a380c8f542@mev.co.uk> From: B K Karthik Date: Wed, 15 Jul 2020 07:34:53 -0400 Message-ID: Subject: Re: [PATCH] staging: comedi: comedi_fops.c: changed type in assignment to unsigned int * To: Ian Abbott Cc: H Hartley Sweeten , Greg Kroah-Hartman , Al Viro , Xiyu Yang , Michel Lespinasse , Divyansh Kamboj , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 15, 2020 at 7:19 AM Ian Abbott wrote: > > On 15/07/2020 05:48, B K Karthik wrote: > > fixed a sparse warning by changing the type in > > assignment from void [noderef] __user * to unsigned int * > > (different address space) > > > > Signed-off-by: B K Karthik > > --- > > drivers/staging/comedi/comedi_fops.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c > > index 3f70e5dfac39..4cc012e231b7 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 *) compat_ptr(v32.chanlist); > > That should be: > > 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; > > > > A reverse cast is required in put_compat_cmd(): > > v32.chanlist = ptr_to_compat((unsigned int __user *)cmd->chanlist); > > Those changes will get rid of the sparse warnings. Thank you for the clarifications Ian. I will make the changes and submit a patch thanks, karthik