Skip to contentSkip to conversation

xen/pci: remove redundant assignment to variable irq

PATCH Applied Colin King 2 participants 2 messages Apr 9, 2020 – Jun 30, 2020

Subsystems (4)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 xen/pci: remove redundant assignment to variable irq

From: Colin Ian King <[email protected]>

The variable irq is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 arch/x86/pci/xen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/pci/xen.c +1 -1
index 91220cc25854..80272eb49230 100644
@@ -63,7 +63,7 @@ static int xen_pcifront_enable_irq(struct pci_dev *dev)
 static int xen_register_pirq(u32 gsi, int gsi_override, int triggering,
 			     bool set_pirq)
 {
-	int rc, pirq = -1, irq = -1;
+	int rc, pirq = -1, irq;
 	struct physdev_map_pirq map_irq;
 	int shareable = 0;
 	char *name;
Signature · 1 line
2.25.1
#1 lore raw

[+cc Juergen, Boris]

Quoted 8 lines · Colin King

From: Colin Ian King <[email protected]>

The variable irq is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")

Applied to pci/virtualization for v5.9, thanks!

I don't see this in linux-next yet, but if anybody else would prefer to take it, let me know and I'll drop it.

Quoted 20 lines
---
 arch/x86/pci/xen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/pci/xen.c +1 -1
index 91220cc25854..80272eb49230 100644
@@ -63,7 +63,7 @@ static int xen_pcifront_enable_irq(struct pci_dev *dev)
 static int xen_register_pirq(u32 gsi, int gsi_override, int triggering,
 			     bool set_pirq)
 {
-	int rc, pirq = -1, irq = -1;
+	int rc, pirq = -1, irq;
 	struct physdev_map_pirq map_irq;
 	int shareable = 0;
 	char *name;
Signature · 1 line
2.25.1