Message ID | 20200802142601.1635926-5-kw@linux.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Remove surplus dev_err() when handing an error from platform_get_irq() | expand |
> -----Original Message----- > From: Krzysztof Wilczyński <kw@linux.com> > Sent: Sunday, August 2, 2020 10:26 PM > To: Bjorn Helgaas <bhelgaas@google.com> > Cc: Jingoo Han <jingoohan1@gmail.com>; Kukjin Kim <kgene@kernel.org>; > Krzysztof Kozlowski <krzk@kernel.org>; Richard Zhu > <hongxing.zhu@nxp.com>; Lucas Stach <l.stach@pengutronix.de>; Shawn > Guo <shawnguo@kernel.org>; Sascha Hauer <s.hauer@pengutronix.de>; > Murali Karicheri <m-karicheri2@ti.com>; Yue Wang > <yue.wang@Amlogic.com>; Kevin Hilman <khilman@baylibre.com>; Thomas > Petazzoni <thomas.petazzoni@bootlin.com>; Jesper Nilsson > <jesper.nilsson@axis.com>; Xiaowei Song <songxiaowei@hisilicon.com>; > Binghui Wang <wangbinghui@hisilicon.com>; Pratyush Anand > <pratyush.anand@gmail.com>; Hou Zhiqiang <Zhiqiang.Hou@nxp.com>; > Linus Walleij <linus.walleij@linaro.org>; Toan Le > <toan@os.amperecomputing.com>; Tan, Ley Foon > <ley.foon.tan@intel.com>; Shawn Lin <shawn.lin@rock-chips.com>; Heiko > Stuebner <heiko@sntech.de>; linux-amlogic@lists.infradead.org; linux-arm- > kernel@axis.com; linux-arm-kernel@lists.infradead.org; linux- > omap@vger.kernel.org; linux-pci@vger.kernel.org; linux- > rockchip@lists.infradead.org; linux-samsung-soc@vger.kernel.org; linux- > tegra@vger.kernel.org; rfi@lists.rocketboards.org > Subject: [PATCH 04/10] PCI: altera: Remove dev_err() when handing an error > from platform_get_irq() > > 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 change is as per suggestion from Coccinelle: > > drivers/pci/controller/pcie-altera.c:717:2-9: line 717 is redundant > because platform_get_irq() already prints an error > > Suggested-by: Bjorn Helgaas <bhelgaas@google.com> > Signed-off-by: Krzysztof Wilczyński <kw@linux.com> > --- Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>
diff --git a/drivers/pci/controller/pcie-altera.c b/drivers/pci/controller/pcie-altera.c index 24cb1c331058..f6d73d282230 100644 --- a/drivers/pci/controller/pcie-altera.c +++ b/drivers/pci/controller/pcie-altera.c @@ -713,10 +713,8 @@ static int altera_pcie_parse_dt(struct altera_pcie *pcie) /* setup IRQ */ pcie->irq = platform_get_irq(pdev, 0); - if (pcie->irq < 0) { - dev_err(dev, "failed to get IRQ: %d\n", pcie->irq); + if (pcie->irq < 0) return pcie->irq; - } irq_set_chained_handler_and_data(pcie->irq, altera_pcie_isr, pcie); return 0;
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 change is as per suggestion from Coccinelle: drivers/pci/controller/pcie-altera.c:717:2-9: line 717 is redundant because platform_get_irq() already prints an error Suggested-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Krzysztof Wilczyński <kw@linux.com> --- drivers/pci/controller/pcie-altera.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)