public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yang Li <yang.lee@linux.alibaba.com>
To: broonie@kernel.org
Cc: conor.dooley@microchip.com, lewis.hanly@microchip.com,
	linux-riscv@lists.infradead.org, linux-spi@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Yang Li <yang.lee@linux.alibaba.com>,
	Abaci Robot <abaci@linux.alibaba.com>
Subject: [PATCH -next 1/2] spi: Remove unnecessary print function dev_err()
Date: Thu,  9 Jun 2022 13:55:33 +0800	[thread overview]
Message-ID: <20220609055533.95866-2-yang.lee@linux.alibaba.com> (raw)
In-Reply-To: <20220609055533.95866-1-yang.lee@linux.alibaba.com>

The function platform_get_irq() never returns 0, and the print function
dev_err() is redundant because platform_get_irq() already prints an error.

Eliminate the follow coccicheck warning:
./drivers/spi/spi-microchip-core.c:543:2-9: line 543 is redundant
because platform_get_irq() already prints an error

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/spi/spi-microchip-core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/spi/spi-microchip-core.c b/drivers/spi/spi-microchip-core.c
index 3bd285dd4964..d8ae25ccffa8 100644
--- a/drivers/spi/spi-microchip-core.c
+++ b/drivers/spi/spi-microchip-core.c
@@ -539,8 +539,7 @@ static int mchp_corespi_probe(struct platform_device *pdev)
 	}
 
 	spi->irq = platform_get_irq(pdev, 0);
-	if (spi->irq <= 0) {
-		dev_err(&pdev->dev, "invalid IRQ %d for SPI controller\n", spi->irq);
+	if (spi->irq < 0) {
 		ret = spi->irq;
 		goto error_release_master;
 	}
-- 
2.20.1.7.g153144c


  reply	other threads:[~2022-06-09  5:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-09  5:55 [PATCH -next 2/2] spi: fix platform_no_drv_owner.cocci warning Yang Li
2022-06-09  5:55 ` Yang Li [this message]
2022-06-09 10:55   ` [PATCH -next 1/2] spi: Remove unnecessary print function dev_err() Mark Brown
2022-06-09 15:15     ` Conor.Dooley
2022-06-09 14:13   ` (subset) " Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220609055533.95866-2-yang.lee@linux.alibaba.com \
    --to=yang.lee@linux.alibaba.com \
    --cc=abaci@linux.alibaba.com \
    --cc=broonie@kernel.org \
    --cc=conor.dooley@microchip.com \
    --cc=lewis.hanly@microchip.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox