Message ID | 20230607093514.104012-1-yang.lee@linux.alibaba.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp132481vqr; Wed, 7 Jun 2023 02:48:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ61nUhDnivUU6WJ9UvjYVdCNWe7X43//21fogapGFE9KhVLXLMECTN6r2kNZBC007gz/Y88 X-Received: by 2002:a17:902:a405:b0:1b0:bf80:d1bb with SMTP id p5-20020a170902a40500b001b0bf80d1bbmr4506409plq.7.1686131293850; Wed, 07 Jun 2023 02:48:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686131293; cv=none; d=google.com; s=arc-20160816; b=PZHJ75eN3JeItFNk93TYTQe/CaJrdajZnaA2WHi2qiUgTrjqlMUfcU6rgLFm+4npWw I9u4XHAQEWKrOYX6GnhuDB0i0XcfJDMxgDAcQyRZoA4sexZgiPAzdQVyr+6mYN81Hg4r WqPf1KJ7Oaxqq1bKcOsTA0svIWf9S8mNX/0fiHEq3xYoGoxBNGuAsN94jHXVmz1f0Is2 IJ1KMOi9MNTUY5lDl41kryVBRnjRDrDti1W8gSPF+VSzKPmtr7JjvBqbvjBDemEiCwt1 zn52Ettjn488tPTrOJYxZzajY3jmHFwACMPoQhjOEMkOvcf86W6vQHd2hMgZoq8Rsz7P VnOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=NOY3NRn/KvNWRXGwlZBfvP6iKd9z8q9pNCH358Yyu8s=; b=n28HDCYE0LQhEPPtAX2LmeqzY0bVPdLzI9HQsq3JdC1xQB33+ocIsicTnx2LCjYX+i GP34Re76RIy2smeshb/BJtxxOB0+pOfxPB3AMV295tnyq0aacpUgj0EbTqjjR2lMO7pP BAoj5AgVZxWL00oiklPj4IRc18ewU8fWO8xjPRK+3MtGBIxw39dRojIgkdt1L3g6rvYe KvgXh+NYldI6BadFDgJTHUv168VH2y0Z7F3of10DvjPruiyk1zo1LiINj2mffNJnrI+Y tlpObWo8WWF1P6n2cndlMlMUuxEszDpGYEqkYe9MjgvH7KQrKrdDQboNZfiBA3+N2HrU Y7vw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n14-20020a170903110e00b001b02ccb155bsi8616780plh.327.2023.06.07.02.48.00; Wed, 07 Jun 2023 02:48:13 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235210AbjFGJfq (ORCPT <rfc822;literming00@gmail.com> + 99 others); Wed, 7 Jun 2023 05:35:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240429AbjFGJf3 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 7 Jun 2023 05:35:29 -0400 Received: from out30-118.freemail.mail.aliyun.com (out30-118.freemail.mail.aliyun.com [115.124.30.118]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 269E31720; Wed, 7 Jun 2023 02:35:18 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R581e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046059;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0Vka6Hhf_1686130515; Received: from localhost(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0Vka6Hhf_1686130515) by smtp.aliyun-inc.com; Wed, 07 Jun 2023 17:35:16 +0800 From: Yang Li <yang.lee@linux.alibaba.com> To: mani@kernel.org Cc: lpieralisi@kernel.org, kw@linux.com, kishon@kernel.org, bhelgaas@google.com, mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Li <yang.lee@linux.alibaba.com>, Abaci Robot <abaci@linux.alibaba.com> Subject: [PATCH -next] PCI: endpoint: Remove redundant dev_err(). Date: Wed, 7 Jun 2023 17:35:14 +0800 Message-Id: <20230607093514.104012-1-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_IN_DEF_SPF_WL 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768036807528146122?= X-GMAIL-MSGID: =?utf-8?q?1768036807528146122?= |
Series |
[-next] PCI: endpoint: Remove redundant dev_err().
|
|
Commit Message
Yang Li
June 7, 2023, 9:35 a.m. UTC
There is no need to call the dev_err() function directly to print a
custom message when handling an error from either the platform_get_irq()
or platform_get_irq_byname() functions as both are going to display an
appropriate error message in case of a failure.
Eliminate the following warning:
./drivers/pci/endpoint/functions/pci-epf-mhi.c:362:2-9: line 362 is redundant because platform_get_irq_byname() already prints an error
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5449
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
drivers/pci/endpoint/functions/pci-epf-mhi.c | 1 -
1 file changed, 1 deletion(-)
Comments
Hi Yang,
kernel test robot noticed the following build warnings:
[auto build test WARNING on next-20230607]
url: https://github.com/intel-lab-lkp/linux/commits/Yang-Li/PCI-endpoint-Remove-redundant-dev_err/20230607-173708
base: next-20230607
patch link: https://lore.kernel.org/r/20230607093514.104012-1-yang.lee%40linux.alibaba.com
patch subject: [PATCH -next] PCI: endpoint: Remove redundant dev_err().
config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20230608/202306080418.i64hTj5T-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build):
git checkout next-20230607
b4 shazam https://lore.kernel.org/r/20230607093514.104012-1-yang.lee@linux.alibaba.com
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=i386 olddefconfig
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/pci/endpoint/functions/
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202306080418.i64hTj5T-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/pci/endpoint/functions/pci-epf-mhi.c: In function 'pci_epf_mhi_bind':
>> drivers/pci/endpoint/functions/pci-epf-mhi.c:347:24: warning: unused variable 'dev' [-Wunused-variable]
347 | struct device *dev = &epf->dev;
| ^~~
vim +/dev +347 drivers/pci/endpoint/functions/pci-epf-mhi.c
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 341
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 342 static int pci_epf_mhi_bind(struct pci_epf *epf)
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 343 {
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 344 struct pci_epf_mhi *epf_mhi = epf_get_drvdata(epf);
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 345 struct pci_epc *epc = epf->epc;
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 346 struct platform_device *pdev = to_platform_device(epc->dev.parent);
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 @347 struct device *dev = &epf->dev;
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 348 struct resource *res;
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 349 int ret;
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 350
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 351 /* Get MMIO base address from Endpoint controller */
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 352 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mmio");
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 353 epf_mhi->mmio_phys = res->start;
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 354 epf_mhi->mmio_size = resource_size(res);
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 355
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 356 epf_mhi->mmio = ioremap(epf_mhi->mmio_phys, epf_mhi->mmio_size);
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 357 if (IS_ERR(epf_mhi->mmio))
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 358 return PTR_ERR(epf_mhi->mmio);
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 359
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 360 ret = platform_get_irq_byname(pdev, "doorbell");
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 361 if (ret < 0) {
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 362 iounmap(epf_mhi->mmio);
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 363 return ret;
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 364 }
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 365
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 366 epf_mhi->irq = ret;
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 367
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 368 return 0;
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 369 }
7db424a84d96b0 Manivannan Sadhasivam 2023-06-02 370
Hello, > There is no need to call the dev_err() function directly to print a > custom message when handling an error from either the platform_get_irq() > or platform_get_irq_byname() functions as both are going to display an > appropriate error message in case of a failure. This extra dev_err() appears to have since been removed, per: https://git.kernel.org/pci/pci/c/1bf5f25324f7 Nevertheless, thank you for sending the patch over! Krzysztof
diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/endpoint/functions/pci-epf-mhi.c index 1227f059ea12..371d6f80845e 100644 --- a/drivers/pci/endpoint/functions/pci-epf-mhi.c +++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c @@ -359,7 +359,6 @@ static int pci_epf_mhi_bind(struct pci_epf *epf) ret = platform_get_irq_byname(pdev, "doorbell"); if (ret < 0) { - dev_err(dev, "Failed to get Doorbell IRQ\n"); iounmap(epf_mhi->mmio); return ret; }