From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83940C433E0 for ; Thu, 18 Feb 2021 12:22:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3CB3864E2F for ; Thu, 18 Feb 2021 12:22:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232456AbhBRMVA (ORCPT ); Thu, 18 Feb 2021 07:21:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232166AbhBRKsu (ORCPT ); Thu, 18 Feb 2021 05:48:50 -0500 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77E34C061574 for ; Thu, 18 Feb 2021 02:48:02 -0800 (PST) Received: by mail-pl1-x634.google.com with SMTP id ba1so1052105plb.1 for ; Thu, 18 Feb 2021 02:48:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=+4Ty2EC198TjRC3tjzE5cKKjZBp6T/djTh3O24sLzhI=; b=i//we/OJgxeAvuLnkMneVfbe0TSZd+ReXSLdt5P9W0bmimlWZu7mOgTtijigZM70i7 caUQbROjdTHl77DWGZlWxPd1aEyJ6od8s7ynMoS6dZD6LT5mKYr+jWahEp5nhNsgk3Hg p+Yc+MoGOx6CtCAJMFRto5Nt0yU8rE5wnhBBggwRrijJufSpLyJ6zrYpW1QVb3FIBpg5 p7RUIFrPjgP7P6GHMA5dGLorwyz+S0ypHk6BvBhm2Zv8grjmIYYbipV2ahwBX2bq27o3 yj+c3qS6SzoAwbfatCfM8JiDgnUW8vW1dleN+I8PoGuj9o4U3El+aBgCpNoGehlSk1zi bnYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=+4Ty2EC198TjRC3tjzE5cKKjZBp6T/djTh3O24sLzhI=; b=kMYdh0n3WUacuu5fmMmia6kRQwjB+o4yQyIATicB9lPvM3CoFWS2Oorh9cH/vt3JlP zqX5Gpf6LQZ0O6bHzNyfBrAkFXuqKslkTAUKvu7tJhh50o8wb1tePfvsfG+a4RieY3Ro +wLyS0EgUiAcjKXSsLyrtRLywWhlLAf89MugSXgvFOr49kcxzH1fLsoYqALmxxX/kpJ0 SUN7sV8dfTdyjU/rFdunTdNUB6xy6vsa7Ng73jygd6PT8xXL8Lg9M4tsqyNWUZuc9HEJ pg1ICVUT/Dk52sf4Y4ZZMhlu1bcLrPXl9AQAGX5SU0U4WW0aeIqeCswyyWISyUlgO35G VE3w== X-Gm-Message-State: AOAM531usGI/0mI9IKjMO8WcstCD2SjdPSg/LlsZirZQg+1Cf/RjN6TV Gob/EpYZ3wINrQWezM7yz9vn4NiTTGQ= X-Google-Smtp-Source: ABdhPJxeHdRECmk1nueMkn3Ncc6IrRQ+cTGJWx1gNCT2bKlWeEOSxOAikP+7f90KUsYupKKGD3YEgA== X-Received: by 2002:a17:90a:d48c:: with SMTP id s12mr3548307pju.123.1613645281914; Thu, 18 Feb 2021 02:48:01 -0800 (PST) Received: from atulu-nitro ([2401:4900:3155:553b:559f:4399:2a05:67d4]) by smtp.gmail.com with ESMTPSA id t15sm5097592pjy.37.2021.02.18.02.47.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Feb 2021 02:48:01 -0800 (PST) Date: Thu, 18 Feb 2021 16:17:55 +0530 From: Atul Gopinathan To: Ian Abbott , gregkh@linuxfoundation.org Cc: hsweeten@visionengravers.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] staging: comedi: cast function output to assigned variable type Message-ID: <20210218104755.GA7571@atulu-nitro> References: <20210218084404.16591-1-atulgopinathan@gmail.com> <8f73b7a1-02dd-32ef-8115-ad0f38868692@mev.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8f73b7a1-02dd-32ef-8115-ad0f38868692@mev.co.uk> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 18, 2021 at 10:31:15AM +0000, Ian Abbott wrote: > On 18/02/2021 08:44, Atul Gopinathan wrote: > > Fix the following warning generated by sparse: > > > > drivers/staging//comedi/comedi_fops.c:2956:23: warning: incorrect type in assignment (different address spaces) > > drivers/staging//comedi/comedi_fops.c:2956:23: expected unsigned int *chanlist > > drivers/staging//comedi/comedi_fops.c:2956:23: got void [noderef] * > > > > compat_ptr() has a return type of "void __user *" > > as defined in "include/linux/compat.h" > > > > cmd->chanlist is of type "unsigned int *" as defined > > in drivers/staging/comedi/comedi.h" in struct > > comedi_cmd. > > > > Signed-off-by: Atul Gopinathan > > --- > > 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 e85a99b68f31..fc4ec38012b4 100644 > > --- a/drivers/staging/comedi/comedi_fops.c > > +++ b/drivers/staging/comedi/comedi_fops.c > > @@ -2953,7 +2953,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; > > > > This patch and the other one in your series clash with commit 9d5d041eebe3 > ("staging: comedi: comedi_fops.c: added casts to get rid of sparse > warnings") by B K Karthik. Oh I see. Not sure if this is the right place to ask, but which tree and branch should one work with when messing with the code in staging/ directory? (wanted to avoid such clashes in future) Thanks, Atul From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3450C433E0 for ; Thu, 18 Feb 2021 10:48:07 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8E35564E2F for ; Thu, 18 Feb 2021 10:48:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8E35564E2F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 327B9863E1; Thu, 18 Feb 2021 10:48:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OmX1xqwqtqct; Thu, 18 Feb 2021 10:48:04 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id BB39F86427; Thu, 18 Feb 2021 10:48:04 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id B76491BF2B9 for ; Thu, 18 Feb 2021 10:48:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B321D872FD for ; Thu, 18 Feb 2021 10:48:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GnWVkmVWu--A for ; Thu, 18 Feb 2021 10:48:02 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by hemlock.osuosl.org (Postfix) with ESMTPS id 6E227872ED for ; Thu, 18 Feb 2021 10:48:02 +0000 (UTC) Received: by mail-pj1-f45.google.com with SMTP id lw17so2697003pjb.0 for ; Thu, 18 Feb 2021 02:48:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=+4Ty2EC198TjRC3tjzE5cKKjZBp6T/djTh3O24sLzhI=; b=i//we/OJgxeAvuLnkMneVfbe0TSZd+ReXSLdt5P9W0bmimlWZu7mOgTtijigZM70i7 caUQbROjdTHl77DWGZlWxPd1aEyJ6od8s7ynMoS6dZD6LT5mKYr+jWahEp5nhNsgk3Hg p+Yc+MoGOx6CtCAJMFRto5Nt0yU8rE5wnhBBggwRrijJufSpLyJ6zrYpW1QVb3FIBpg5 p7RUIFrPjgP7P6GHMA5dGLorwyz+S0ypHk6BvBhm2Zv8grjmIYYbipV2ahwBX2bq27o3 yj+c3qS6SzoAwbfatCfM8JiDgnUW8vW1dleN+I8PoGuj9o4U3El+aBgCpNoGehlSk1zi bnYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=+4Ty2EC198TjRC3tjzE5cKKjZBp6T/djTh3O24sLzhI=; b=unwS99JTFW49Xbd0o74DUcozFeuDD3ReD9MIFYBJvxTlsuUp9vPAxCEMlaO2ZZgOOM X3CyX0/jlI7SbyHjz7j3vbBoVcMSmnMTHVCY6L+mg6kid7qtN5G//sjwvGOxLUr3eDg9 SbP/L4RCElDIYVGm1HFHC7upDpzgKRuYDQA2i3gbnmlDcd0/K352XFVMaUyxYqarJ9WS EVvOENnK9hV6vs0qsqAaP9a+MvNd3ZKmLOoO3pnZbszNDlnyEc/0GJjoSqXpe08YMqEs aLYiWuaIPf/0iw69S00oZwqFnIg9aIUfF4Vy4K0Yllq9/cHIz/wH6flwbd3soXdbjap7 A5ug== X-Gm-Message-State: AOAM5336cF5/NGiIhmqOZDEfn2/N992/oVCU1Uwd34MAaTiXH7wCtkdm jlSdz88Lm/dWfWCBYGO6Ebo= X-Google-Smtp-Source: ABdhPJxeHdRECmk1nueMkn3Ncc6IrRQ+cTGJWx1gNCT2bKlWeEOSxOAikP+7f90KUsYupKKGD3YEgA== X-Received: by 2002:a17:90a:d48c:: with SMTP id s12mr3548307pju.123.1613645281914; Thu, 18 Feb 2021 02:48:01 -0800 (PST) Received: from atulu-nitro ([2401:4900:3155:553b:559f:4399:2a05:67d4]) by smtp.gmail.com with ESMTPSA id t15sm5097592pjy.37.2021.02.18.02.47.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Feb 2021 02:48:01 -0800 (PST) Date: Thu, 18 Feb 2021 16:17:55 +0530 From: Atul Gopinathan To: Ian Abbott , gregkh@linuxfoundation.org Subject: Re: [PATCH v2 1/2] staging: comedi: cast function output to assigned variable type Message-ID: <20210218104755.GA7571@atulu-nitro> References: <20210218084404.16591-1-atulgopinathan@gmail.com> <8f73b7a1-02dd-32ef-8115-ad0f38868692@mev.co.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <8f73b7a1-02dd-32ef-8115-ad0f38868692@mev.co.uk> X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" On Thu, Feb 18, 2021 at 10:31:15AM +0000, Ian Abbott wrote: > On 18/02/2021 08:44, Atul Gopinathan wrote: > > Fix the following warning generated by sparse: > > > > drivers/staging//comedi/comedi_fops.c:2956:23: warning: incorrect type in assignment (different address spaces) > > drivers/staging//comedi/comedi_fops.c:2956:23: expected unsigned int *chanlist > > drivers/staging//comedi/comedi_fops.c:2956:23: got void [noderef] * > > > > compat_ptr() has a return type of "void __user *" > > as defined in "include/linux/compat.h" > > > > cmd->chanlist is of type "unsigned int *" as defined > > in drivers/staging/comedi/comedi.h" in struct > > comedi_cmd. > > > > Signed-off-by: Atul Gopinathan > > --- > > 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 e85a99b68f31..fc4ec38012b4 100644 > > --- a/drivers/staging/comedi/comedi_fops.c > > +++ b/drivers/staging/comedi/comedi_fops.c > > @@ -2953,7 +2953,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; > > > > This patch and the other one in your series clash with commit 9d5d041eebe3 > ("staging: comedi: comedi_fops.c: added casts to get rid of sparse > warnings") by B K Karthik. Oh I see. Not sure if this is the right place to ask, but which tree and branch should one work with when messing with the code in staging/ directory? (wanted to avoid such clashes in future) Thanks, Atul _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel