linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: versatile: Remove redundant variable retval
@ 2022-04-18 14:44 Colin Ian King
  2022-04-28  9:48 ` Lorenzo Pieralisi
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-04-18 14:44 UTC (permalink / raw)
  To: Rob Herring, Lorenzo Pieralisi, Krzysztof Wilczyński,
	Bjorn Helgaas, linux-pci, linux-arm-kernel
  Cc: kernel-janitors, linux-kernel, llvm

Variable retval is being assigned a value that is never read, the
variable is redundant and can be removed.

Cleans up clang scan build warning:
drivers/pci/controller/pci-versatile.c:37:10: warning: Although the value
stored to 'retval' is used in the enclosing expression, the value is never
actually read from 'retval' [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/pci/controller/pci-versatile.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pci/controller/pci-versatile.c b/drivers/pci/controller/pci-versatile.c
index 653d5d0ecf81..7991d334e0f1 100644
--- a/drivers/pci/controller/pci-versatile.c
+++ b/drivers/pci/controller/pci-versatile.c
@@ -31,10 +31,9 @@ static u32 pci_slot_ignore;
 
 static int __init versatile_pci_slot_ignore(char *str)
 {
-	int retval;
 	int slot;
 
-	while ((retval = get_option(&str, &slot))) {
+	while (get_option(&str, &slot)) {
 		if ((slot < 0) || (slot > 31))
 			pr_err("Illegal slot value: %d\n", slot);
 		else
-- 
2.35.1


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

* Re: [PATCH] PCI: versatile: Remove redundant variable retval
  2022-04-18 14:44 [PATCH] PCI: versatile: Remove redundant variable retval Colin Ian King
@ 2022-04-28  9:48 ` Lorenzo Pieralisi
  0 siblings, 0 replies; 2+ messages in thread
From: Lorenzo Pieralisi @ 2022-04-28  9:48 UTC (permalink / raw)
  To: Colin Ian King, Krzysztof Wilczyński, linux-arm-kernel,
	Bjorn Helgaas, Rob Herring, linux-pci
  Cc: Lorenzo Pieralisi, kernel-janitors, linux-kernel, llvm

On Mon, 18 Apr 2022 15:44:16 +0100, Colin Ian King wrote:
> Variable retval is being assigned a value that is never read, the
> variable is redundant and can be removed.
> 
> Cleans up clang scan build warning:
> drivers/pci/controller/pci-versatile.c:37:10: warning: Although the value
> stored to 'retval' is used in the enclosing expression, the value is never
> actually read from 'retval' [deadcode.DeadStores]
> 
> [...]

Applied to pci/versatile, thanks!

[1/1] PCI: versatile: Remove redundant variable retval
      https://git.kernel.org/lpieralisi/pci/c/6086987bde

Thanks,
Lorenzo

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

end of thread, other threads:[~2022-04-28  9:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-18 14:44 [PATCH] PCI: versatile: Remove redundant variable retval Colin Ian King
2022-04-28  9:48 ` Lorenzo Pieralisi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).