Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1379126ybg; Wed, 29 Jul 2020 12:36:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqFZqkEK4ieluDoxx5QulALAhv0YrsntDl2Pvv4s+B2hgZnU4vvlGO/LJm4svm15gqJTgH X-Received: by 2002:a50:ba85:: with SMTP id x5mr77604ede.38.1596051377908; Wed, 29 Jul 2020 12:36:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596051377; cv=none; d=google.com; s=arc-20160816; b=TtVLxl4SVVaRSkfY7REcjuxeRlDvzwdAKT20arnwrZIW5WWA7ern1nkiA98el8Zq1c psZS2wdlPy+s2CPPtO4fPdmEWvpVVoQc9AaLWGSODfqDLqkqc3YuRs062oF/sKj+sTzw U5H47hmSEV+RAKFXSkRaMAnP2B5PIovZaYzz89MclWgWd0PiVewPsstPlABb9H2NlrBi P0TfFzVozcvpmrSvc9s5j1R8+EctCSQ0efRJF0YvbwCZeNe63UxJNa5MUjVPJ0ywohnk rTL999t0QHR4SKm/Z8C4PtPmKHcyW1j6IZKoZzIx3MyZ10fNfoqHkUEilFwiPS6K1Fv3 dREw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=bzV0Gk8sDS15So9N09kMmX5QyvGi8nVKj0J6ODMRLR8=; b=Klj3VmhT65K2cu9RYGRPkHamxIgMj/A6rAZW7l5aGzKhN05TKV+7c9gZ5QZIcLZz+c 4eiWf0suUVUNQ6Qc3lIhNQ0qlhwVsAzhv1/2WKB4Ryg3CIdgYSwHeA6WYioieEMwIHEj cZF9FfuL7rrg6JRd9ru2GCfx9HwO7gOu8S/KuurqSzWUIFKDQL+F4i9ZerZMM8TuAKcT Y/MgHIAi5/28gmVq3mPS/r2evuOUq0oysgIDhd1jH/bWmO9tNIa7o6U0Cedsvn3HJVww 52SfsN5IFUEFRVQCL13armmHLId/Ks7OJseBq+Veh4dwbAntxSyuQvPtselF+9MVW0o/ DJuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=va7MDQS4; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y8si2082391edw.59.2020.07.29.12.35.55; Wed, 29 Jul 2020 12:36:17 -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=@kernel.org header.s=default header.b=va7MDQS4; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726814AbgG2TfH (ORCPT + 99 others); Wed, 29 Jul 2020 15:35:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:34312 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726628AbgG2TfH (ORCPT ); Wed, 29 Jul 2020 15:35:07 -0400 Received: from localhost (mobile-166-175-62-240.mycingular.net [166.175.62.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D4401206D4; Wed, 29 Jul 2020 19:35:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596051306; bh=NzOavhypQiRK+fikxf4URNUQ281LTHgwzpWksY2B5j8=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=va7MDQS4LRM/ecdjwCpXltGEt61+wCS4zFLaeboEgcCzWoFtgvvCQ4mSKNBo1v66o wz2Uh5D6HO6Dy9eG/p1Bf0vSGoUPoVI+35+kLyInUV3IjtOr90muXlZHNNr4BbqMhN JZLkbfYMCKz4mg72FAqJvBOtPjkvQUEKTX0JFhJw= Date: Wed, 29 Jul 2020 14:35:04 -0500 From: Bjorn Helgaas To: Logan Gunthorpe Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Bjorn Helgaas , Kelvin.Cao@microchip.com Subject: Re: [PATCH 1/2] PCI/switechtec: Add missing __iomem and __user tags to fix sparse warnings Message-ID: <20200729193504.GA1960928@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200728192434.18993-1-logang@deltatee.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 28, 2020 at 01:24:33PM -0600, Logan Gunthorpe wrote: > Fix a number of missing __iomem and __user tags in the ioctl functions of > the switchtec driver. This fixes a number of sparse warnings of the form: > > sparse: sparse: incorrect type in ... (different address spaces) > > Fixes: 52eabba5bcdb ("switchtec: Add IOCTLs to the Switchtec driver") > Signed-off-by: Logan Gunthorpe Applied to pci/switchtec for v5.9, thanks! > --- > > Here are a couple quick patches to fix some sparse warnings I was > notified about a couple weeks ago. > > I've split them into two patches based on Fixes tag, but they could be > squashed depending on the preference. > > Thanks! > > drivers/pci/switch/switchtec.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c > index 850cfeb74608..3d5da7f44378 100644 > --- a/drivers/pci/switch/switchtec.c > +++ b/drivers/pci/switch/switchtec.c > @@ -940,7 +940,7 @@ static u32 __iomem *event_hdr_addr(struct switchtec_dev *stdev, > size_t off; > > if (event_id < 0 || event_id >= SWITCHTEC_IOCTL_MAX_EVENTS) > - return ERR_PTR(-EINVAL); > + return (u32 __iomem *)ERR_PTR(-EINVAL); > > off = event_regs[event_id].offset; > > @@ -948,10 +948,10 @@ static u32 __iomem *event_hdr_addr(struct switchtec_dev *stdev, > if (index == SWITCHTEC_IOCTL_EVENT_LOCAL_PART_IDX) > index = stdev->partition; > else if (index < 0 || index >= stdev->partition_count) > - return ERR_PTR(-EINVAL); > + return (u32 __iomem *)ERR_PTR(-EINVAL); > } else if (event_regs[event_id].map_reg == pff_ev_reg) { > if (index < 0 || index >= stdev->pff_csr_count) > - return ERR_PTR(-EINVAL); > + return (u32 __iomem *)ERR_PTR(-EINVAL); > } > > return event_regs[event_id].map_reg(stdev, off, index); > @@ -1057,11 +1057,11 @@ static int ioctl_event_ctl(struct switchtec_dev *stdev, > } > > static int ioctl_pff_to_port(struct switchtec_dev *stdev, > - struct switchtec_ioctl_pff_port *up) > + struct switchtec_ioctl_pff_port __user *up) > { > int i, part; > u32 reg; > - struct part_cfg_regs *pcfg; > + struct part_cfg_regs __iomem *pcfg; > struct switchtec_ioctl_pff_port p; > > if (copy_from_user(&p, up, sizeof(p))) > @@ -1104,10 +1104,10 @@ static int ioctl_pff_to_port(struct switchtec_dev *stdev, > } > > static int ioctl_port_to_pff(struct switchtec_dev *stdev, > - struct switchtec_ioctl_pff_port *up) > + struct switchtec_ioctl_pff_port __user *up) > { > struct switchtec_ioctl_pff_port p; > - struct part_cfg_regs *pcfg; > + struct part_cfg_regs __iomem *pcfg; > > if (copy_from_user(&p, up, sizeof(p))) > return -EFAULT; > > base-commit: 92ed301919932f777713b9172e525674157e983d > -- > 2.20.1