Skip to contentSkip to conversation

PCI: xilinx: testing wrong variable in setup irq function

PATCH In review Dan Carpenter 3 participants 3 messages Sep 9, 2014 – Sep 16, 2014

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

PATCH 1/1 PCI: xilinx: testing wrong variable in setup irq function

We should be testing "hwirq" instead of "irq". "irq" is unsigned so it's never less than zero. Also it's uninitialized.

drivers/pci/host/pcie-xilinx.c +2 -2
index 44f8944..ccc496b 100644
@@ -359,8 +359,8 @@ static int xilinx_pcie_msi_setup_irq(struct msi_chip *chip,
 	phys_addr_t msg_addr;
 
 	hwirq = xilinx_pcie_assign_msi(port);
-	if (irq < 0)
-		return irq;
+	if (hwirq < 0)
+		return hwirq;
 
 	irq = irq_create_mapping(port->irq_domain, hwirq);
 	if (!irq)
Acked-by on v1 1/1
#1 lore raw

Hi Dan,

Quoted 18 lines

-----Original Message-----
From: Dan Carpenter [mailto:[email protected]]
Sent: Tuesday, September 09, 2014 5:42 PM
To: Bjorn Helgaas; Srikanth Thokala
Cc: Michal Simek; Grant Likely; Rob Herring; Srikanth Thokala; Arnd Bergmann; [email protected]; [email protected]
Subject: [patch] PCI: xilinx: testing wrong variable in setup irq function

We should be testing "hwirq" instead of "irq". "irq" is unsigned so it's never less than zero. Also it's uninitialized.

drivers/pci/host/pcie-xilinx.c index renamed from drivers/pci/host/pcie-xilinx.c +0 -0

44f8944..ccc496b 100644

drivers/pci/host/pcie-xilinx.c static int xilinx_pcie_msi_setup_irq(struct msi_chip · line 364

Quoted 8 lines
drivers/pci/host/pcie-xilinx.c +2 -2
@@ -359,8 +359,8 @@ static int xilinx_pcie_msi_setup_irq(struct msi_chip
 *chip,
      phys_addr_t msg_addr;
 
      hwirq = xilinx_pcie_assign_msi(port);
-     if (irq < 0)
-             return irq;
+     if (hwirq < 0)
+             return hwirq;

It is a typo from my end, thanks for sending this patch. Really thanks for helping to improve this.

- Srikanth

drivers/pci/host/pcie-xilinx.c static int xilinx_pcie_msi_setup_irq(struct msi_chip *chip, · line 366

Quoted 3 lines
drivers/pci/host/pcie-xilinx.c +0 -0
      irq = irq_create_mapping(port->irq_domain, hwirq);
      if (!irq)

This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.

maintainer
#2 lore raw
In reply to Dan Carpenter
Quoted 4 lines · Dan Carpenter

We should be testing "hwirq" instead of "irq". "irq" is unsigned so it's never less than zero. Also it's uninitialized.

Applied with Srikanth's ack to pci/host-xilinx for v3.18, thanks.

Quoted 16 lines
drivers/pci/host/pcie-xilinx.c +2 -2
index 44f8944..ccc496b 100644
@@ -359,8 +359,8 @@ static int xilinx_pcie_msi_setup_irq(struct msi_chip *chip,
 	phys_addr_t msg_addr;
 
 	hwirq = xilinx_pcie_assign_msi(port);
-	if (irq < 0)
-		return irq;
+	if (hwirq < 0)
+		return hwirq;
 
 	irq = irq_create_mapping(port->irq_domain, hwirq);
 	if (!irq)