Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2110831ybh; Fri, 17 Jul 2020 09:32:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKsJMJ0T5tc+PzwfwYyzmJWWc5XEuMgz9g4+Kyovbc7qOxLKEoPwz4ceN8dvLp5f3/iRgd X-Received: by 2002:a17:907:205c:: with SMTP id pg28mr8820019ejb.22.1595003530143; Fri, 17 Jul 2020 09:32:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595003530; cv=none; d=google.com; s=arc-20160816; b=jHTPfoRoUWgmkt+uJ7PJwlFsY67F9OfU19VoT+2U2VAhJnaSEenh4Gd2+RIgI9Uull hdDURJM2RZU/LPhDdor3Gz6raRqS/lhT9prOtKUFCXZYF2hBT9yzOqqs7mW65EJLDcP9 mbBXowoO9t3BMkPdCHnMC9Gwg/DBrCAwHZT+113bEZvj7zBasY99bKqiR50p2a3x/CYD J1QYlujvOBN5ZKbFfgXUis9sJAFcr6QuQZt8Lzcxm7hTReLwqzR3EW4g4MKsGfQ5ivg8 8VjufbdfWv+4skElxs7sX23HB+h7raKguqYhg+N67ClnTIVQhciUkkGPGfq3qawMTMRG yJlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=TauTiD9PxrSdJF/ty1rgXq7psXj8ujcT2UdhlLahar4=; b=H+0YaP54WbJ/YXy67Ev1tSN7PkuAEN6D/16i1if/8Fc7g6ozG5OfyEGErzdtmE8cvP Qj04zQwvgnIwp4bnJ597hMV9nmZW/YxfrxZYDWBJYX8HSlYtbD6BKrgeIab0dWmHMNHh XA4X9Dk/JcN5jWI5hEVb4sjGFjxJ+Yr85IiCvJHb7jY9CpJmRM5095R72mot30E13cGF beQ9L7CFpSrC6a9eFaotrRLxZkOWk7eYmOdQJp6nr3cdjRdMiDUD+6kyzQDN8nKXoK2P sFuwVHiBXlmaatmDSK2ArUhOJTQ4G8O32vrOlnck6xpoeElEUbW1O34Ib+atz6Ax3sgl MCAQ== ARC-Authentication-Results: i=1; mx.google.com; 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 i23si5620933ejj.300.2020.07.17.09.31.47; Fri, 17 Jul 2020 09:32:10 -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; 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 S1726777AbgGQQbT (ORCPT + 99 others); Fri, 17 Jul 2020 12:31:19 -0400 Received: from foss.arm.com ([217.140.110.172]:45286 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726393AbgGQQbS (ORCPT ); Fri, 17 Jul 2020 12:31:18 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9D75312FC; Fri, 17 Jul 2020 09:31:17 -0700 (PDT) Received: from e121166-lin.cambridge.arm.com (e121166-lin.cambridge.arm.com [10.1.196.255]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 82CF33F68F; Fri, 17 Jul 2020 09:31:16 -0700 (PDT) Date: Fri, 17 Jul 2020 17:31:11 +0100 From: Lorenzo Pieralisi To: Dejin Zheng Cc: m-karicheri2@ti.com, robh@kernel.org, bhelgaas@google.com, gustavo.pimentel@synopsys.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, kernel test robot Subject: Re: [PATCH v1] PCI: dwc: fix a warning about variable 'res' is uninitialized Message-ID: <20200717163111.GA8421@e121166-lin.cambridge.arm.com> References: <20200717133007.23858-1-zhengdejin5@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200717133007.23858-1-zhengdejin5@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 17, 2020 at 09:30:07PM +0800, Dejin Zheng wrote: > The kernel test robot reported a compile warning, > > drivers/pci/controller/dwc/pci-keystone.c:1236:18: warning: variable 'res' > is uninitialized when used here [-Wuninitialized] > > The commit c59a7d771134b5 ("PCI: dwc: Convert to > devm_platform_ioremap_resource_byname()") did a wrong conversion for > keystone driver. the commit use devm_platform_ioremap_resource_byname() > to replace platform_get_resource_byname() and devm_ioremap_resource(). > but the subsequent code needs to use the variable 'res', which is got by > platform_get_resource_byname() for resource "app". so revert it. > > Fixes: c59a7d771134b5 ("PCI: dwc: Convert to devm_platform_ioremap_resource_byname()") > Reported-by: kernel test robot > Signed-off-by: Dejin Zheng > --- > drivers/pci/controller/dwc/pci-keystone.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Squashed in the commit it is fixing, thanks. Lorenzo > diff --git a/drivers/pci/controller/dwc/pci-keystone.c b/drivers/pci/controller/dwc/pci-keystone.c > index 5ffc3b40c4f6..00279002102e 100644 > --- a/drivers/pci/controller/dwc/pci-keystone.c > +++ b/drivers/pci/controller/dwc/pci-keystone.c > @@ -1228,8 +1228,8 @@ static int __init ks_pcie_probe(struct platform_device *pdev) > if (!pci) > return -ENOMEM; > > - ks_pcie->va_app_base = > - devm_platform_ioremap_resource_byname(pdev, "app"); > + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "app"); > + ks_pcie->va_app_base = devm_ioremap_resource(dev, res); > if (IS_ERR(ks_pcie->va_app_base)) > return PTR_ERR(ks_pcie->va_app_base); > > -- > 2.25.0 >