Skip to contentSkip to conversation

PCI: versatile: Remove redundant variable retval

PATCH Applied Colin Ian King 2 participants 2 messages Apr 18, 2022 – Apr 28, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: versatile: Remove redundant variable retval

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]

---
 drivers/pci/controller/pci-versatile.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pci/controller/pci-versatile.c +1 -2
index 653d5d0ecf81..7991d334e0f1 100644
@@ -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
Signature · 1 line
2.35.1
#1 lore raw
Quoted 9 lines · Colin Ian King

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