aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>2014-05-25 14:50:06 -0400
committerGrant Likely <grant.likely@linaro.org>2014-05-27 07:13:34 -0400
commit08cf78ed41feaa21017487bad0a5a405c6cede43 (patch)
tree14a8a16ec61dc5f604c3b8abfc87aa58afe76a5d
parentad69674e73a18dc3a8da557f4059ccf9389531a5 (diff)
of_pci_irq: kill useless variable in of_irq_parse_pci()
The 'lspec' variable only caused pointless promotions from u8 to u32 on each loop iteration, while it's enough to promote only once, after the loop. Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: Grant Likely <grant.likely@linaro.org>
-rw-r--r--drivers/of/of_pci_irq.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/of/of_pci_irq.c b/drivers/of/of_pci_irq.c
index 7e4e21438e28..1710d9dc7fc2 100644
--- a/drivers/of/of_pci_irq.c
+++ b/drivers/of/of_pci_irq.c
@@ -18,7 +18,6 @@ int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq
18{ 18{
19 struct device_node *dn, *ppnode; 19 struct device_node *dn, *ppnode;
20 struct pci_dev *ppdev; 20 struct pci_dev *ppdev;
21 u32 lspec;
22 __be32 laddr[3]; 21 __be32 laddr[3];
23 u8 pin; 22 u8 pin;
24 int rc; 23 int rc;
@@ -45,7 +44,6 @@ int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq
45 return -ENODEV; 44 return -ENODEV;
46 45
47 /* Now we walk up the PCI tree */ 46 /* Now we walk up the PCI tree */
48 lspec = pin;
49 for (;;) { 47 for (;;) {
50 /* Get the pci_dev of our parent */ 48 /* Get the pci_dev of our parent */
51 ppdev = pdev->bus->self; 49 ppdev = pdev->bus->self;
@@ -79,13 +77,13 @@ int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq
79 /* We can only get here if we hit a P2P bridge with no node, 77 /* We can only get here if we hit a P2P bridge with no node,
80 * let's do standard swizzling and try again 78 * let's do standard swizzling and try again
81 */ 79 */
82 lspec = pci_swizzle_interrupt_pin(pdev, lspec); 80 pin = pci_swizzle_interrupt_pin(pdev, pin);
83 pdev = ppdev; 81 pdev = ppdev;
84 } 82 }
85 83
86 out_irq->np = ppnode; 84 out_irq->np = ppnode;
87 out_irq->args_count = 1; 85 out_irq->args_count = 1;
88 out_irq->args[0] = lspec; 86 out_irq->args[0] = pin;
89 laddr[0] = cpu_to_be32((pdev->bus->number << 16) | (pdev->devfn << 8)); 87 laddr[0] = cpu_to_be32((pdev->bus->number << 16) | (pdev->devfn << 8));
90 laddr[1] = laddr[2] = cpu_to_be32(0); 88 laddr[1] = laddr[2] = cpu_to_be32(0);
91 return of_irq_parse_raw(laddr, out_irq); 89 return of_irq_parse_raw(laddr, out_irq);