From: Li Ningke <lnk_01@hust.edu.cn>
To: Mark Brown <broonie@kernel.org>
Cc: hust-os-kernel-patches@googlegroups.com,
Li Ningke <lnk_01@hust.edu.cn>, Dongliang Mu <dzm91@hust.edu.cn>,
linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] spi: davinci: Remove dead code in `davinci_spi_probe()`
Date: Sun, 23 Apr 2023 03:24:46 +0000 [thread overview]
Message-ID: <20230423032446.34347-1-lnk_01@hust.edu.cn> (raw)
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
next reply other threads:[~2023-04-23 3:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-23 3:24 Li Ningke [this message]
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
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=20230423032446.34347-1-lnk_01@hust.edu.cn \
--to=lnk_01@hust.edu.cn \
--cc=broonie@kernel.org \
--cc=dzm91@hust.edu.cn \
--cc=hust-os-kernel-patches@googlegroups.com \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®