mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] spi: davinci: Remove dead code in `davinci_spi_probe()`
@ 2023-04-23  3:24 Li Ningke
  2023-04-24 11:48 ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Li Ningke @ 2023-04-23  3:24 UTC (permalink / raw)
  To: Mark Brown
  Cc: hust-os-kernel-patches, Li Ningke, Dongliang Mu, linux-spi, linux-kernel

Smatch complains that
drivers/spi/spi-davinci.c:915 davinci_spi_probe() warn:
platform_get_irq() does not return zero

There is no need to check whether the return value is zero as
`platform_get_irq()` only returns non-zero IRQ number on success
or negative error number on failure, removing them to solve this
problem.

Signed-off-by: Li Ningke <lnk_01@hust.edu.cn>
Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn>
---
The issue is found by static analysis and the patch remains untested.
---
 drivers/spi/spi-davinci.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c
index d112c2cac042..fdb241e3a7bf 100644
--- a/drivers/spi/spi-davinci.c
+++ b/drivers/spi/spi-davinci.c
@@ -912,8 +912,6 @@ static int davinci_spi_probe(struct platform_device *pdev)
 	init_completion(&dspi->done);
 
 	ret = platform_get_irq(pdev, 0);
-	if (ret == 0)
-		ret = -EINVAL;
 	if (ret < 0)
 		goto free_master;
 	dspi->irq = ret;
-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-04-26 15:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-23  3:24 [PATCH] spi: davinci: Remove dead code in `davinci_spi_probe()` Li Ningke
2023-04-24 11:48 ` Mark Brown
2023-04-24 12:03   ` Dongliang Mu
2023-04-24 15:52     ` Mark Brown
2023-04-26  1:50       ` Dongliang Mu
2023-04-26 14:13         ` Mark Brown
2023-04-26 15:07           ` Dongliang Mu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®