Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp5092466rwb; Sun, 22 Jan 2023 03:10:51 -0800 (PST) X-Google-Smtp-Source: AMrXdXuYkGcXuZV+Hx8tSDNtuFokRC7VYi00vIyhw2vlRdvWJcEh4jMNDGBYiwkkFNYqg4cG5XJH X-Received: by 2002:a05:6a21:339a:b0:a7:345a:100f with SMTP id yy26-20020a056a21339a00b000a7345a100fmr27447020pzb.10.1674385851237; Sun, 22 Jan 2023 03:10:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674385851; cv=none; d=google.com; s=arc-20160816; b=Ugx1g0W0qpQZchDMgATB8D4wQ7Ij7NEr/uW4S9WmGvna2b83f3aRAHQXKRdmJxTLS0 1ua/ZhV9rSAOVbnPGTjFWQ/e1CnWLL6MvsnloTxE9PVK7SWRojQ+nRzjYsJL9bXxkQm0 C+5up1ce4FISumDuzNhN2D2ycCnY0+NwNFXeuSadNkUf6+Tue+MEaYiqAN4EXYrvVcJ0 DGI1GEauXFWRzgdVJcGOepEvtc9xNvjrPpwhzNNnwj4WXLpMkzlOAxcLFrimZgDYeZAL ECsVDGCR+KW8A/nnfiuCqGMzC5VsfczEzTJewNIlYxTDkt9J/vhUSBwYwiH1UfF7SyQG 0ODA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=jw0PXcHTwPFuUoJ1So5iHA8U0+VxUluz2Y8fa9Q/xU4=; b=BYblR4boOKk/uWKLsV2/gitYJyVf0DAOGu8ltPjyFnjyO2aUWzx/lh4sXFUHLCeoNJ 38FlNUUULn/KP3ezNR1tN7sv7EGewV1mY6btRFA/+CM/IG9rbTZGVA1SDAi80xNDJxm3 Mme4JcyF+clIPCW1Ngfaiv5hc8NKrYCCjqT+qGWKC53/exzJoHa1GqeuUDUWoEB1z8zC nr15bLW82RRS5LOsDqqWDEC/RbDeWJ7G4L8jU+RHWYT4MnnKhp7PiBvdnFurAgyXc+dW PoM2cFy8FAX65nkWEQtNVFdE2p+Cnfm/y5QX3OiAE9dQMSAzK6LYmT6I3PoJ9rEIQHTc vnZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=B4nNX53d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q2-20020a63e202000000b004a296463035si25852794pgh.781.2023.01.22.03.10.45; Sun, 22 Jan 2023 03:10:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=B4nNX53d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229880AbjAVKr1 (ORCPT + 52 others); Sun, 22 Jan 2023 05:47:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229622AbjAVKr0 (ORCPT ); Sun, 22 Jan 2023 05:47:26 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E2AC13500; Sun, 22 Jan 2023 02:47:25 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 07B6660BC5; Sun, 22 Jan 2023 10:47:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59610C433EF; Sun, 22 Jan 2023 10:47:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674384444; bh=qOi/1Aqwa2JrdVvobn/vFD9TgB5xq1PG7dJtowJf2C0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=B4nNX53dDuo4U+hzDxPjlFuvEq0hmZSf8x9ecggu678w231t/jH/C0S6xgtdeJPco C/ZpbtMZ5wR4DkFVv5rSRAKWw9Wf748d0PeKvbytE6zfW3zk85+HJAPv4gJAjSwGdr b5AGXTrqZsT1dOa/rUfPOrpqcNtv3z1Zbl6oC/N39+Di3eIIfBGkesuhoiBWJQSLbH k2OXRLaiw0GZ3KtDKztztbMjFTMwZSZKoAwVxJ9V0vvf0plr0zfgKw8l1M366uXCQT F7jPkaG4vMaD8FDaNW5S9V/cQIadBtjS/q/SYNQQeqG8yH1j30JDmmdY9M9TvmAJDn 2hLd/6z1qo91A== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pJXsf-003kAw-Si; Sun, 22 Jan 2023 10:47:22 +0000 Date: Sun, 22 Jan 2023 10:47:21 +0000 Message-ID: <86h6win8w6.wl-maz@kernel.org> From: Marc Zyngier To: Lizhe Cc: bhelgaas@google.com, tglx@linutronix.de, darwi@linutronix.de, jgg@ziepe.ca, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] drivers/msi.c : use devm_ioremap replace ioremap In-Reply-To: <20230121170420.8681-1-sensor1010@163.com> References: <20230121170420.8681-1-sensor1010@163.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: sensor1010@163.com, bhelgaas@google.com, tglx@linutronix.de, darwi@linutronix.de, jgg@ziepe.ca, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 21 Jan 2023 17:04:20 +0000, Lizhe wrote: > > use devm_ioremap replace ioremap > > Signed-off-by: Lizhe > --- > drivers/pci/msi/msi.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pci/msi/msi.c b/drivers/pci/msi/msi.c > index 1f716624ca56..184eca85b88b 100644 > --- a/drivers/pci/msi/msi.c > +++ b/drivers/pci/msi/msi.c > @@ -566,7 +566,7 @@ static void __iomem *msix_map_region(struct pci_dev *dev, > table_offset &= PCI_MSIX_TABLE_OFFSET; > phys_addr = pci_resource_start(dev, bir) + table_offset; > > - return ioremap(phys_addr, nr_entries * PCI_MSIX_ENTRY_SIZE); > + return devm_ioremap(&dev->dev, phys_addr, nr_entries * PCI_MSIX_ENTRY_SIZE); > } And where is the unmap dealt with? From what I can see, this will probably explode when the device is removed... M. -- Without deviation from the norm, progress is not possible.