lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230423032446.34347-1-lnk_01@hust.edu.cn>
Date:   Sun, 23 Apr 2023 03:24:46 +0000
From:   Li Ningke <lnk_01@...t.edu.cn>
To:     Mark Brown <broonie@...nel.org>
Cc:     hust-os-kernel-patches@...glegroups.com,
        Li Ningke <lnk_01@...t.edu.cn>,
        Dongliang Mu <dzm91@...t.edu.cn>, linux-spi@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH] spi: davinci: Remove dead code in `davinci_spi_probe()`

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@...t.edu.cn>
Reviewed-by: Dongliang Mu <dzm91@...t.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ