PCI: xilinx: testing wrong variable in setup irq function
Subsystems (3)
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
@@ -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)
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 functionWe should be testing "hwirq" instead of "irq". "irq" is unsigned so it's never less than zero. Also it's uninitialized.
Signed-off-by Dan Carpenter <[email protected]>drivers/pci/host/pcie-xilinx.c index renamed from drivers/pci/host/pcie-xilinx.c +0
-044f8944..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
-0irq =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.
Bjorn Helgaas
maintainerQuoted 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.
Signed-off-by Dan Carpenter <[email protected]>
Applied with Srikanth's ack to pci/host-xilinx for v3.18, thanks.
Quoted 16 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; irq =irq_create_mapping (port->irq_domain, hwirq);if (!irq)