Commit 18c25526 authored by Matt Fleming's avatar Matt Fleming Committed by Tony Luck

ia64/PCI: Fix incorrect PCI resource end address

commit f976721e ("ia64/PCI: Use ioremap() instead of open-coded
equivalent") introduced the following compiler warning,

  arch/ia64/sn/kernel/io_init.c: In function 'sn_io_slot_fixup':
  arch/ia64/sn/kernel/io_init.c:189:19: warning: 'addr' may be used uninitialized in this function [-Wmaybe-uninitialized]
     res->end = addr + size;
                   ^

'addr' is indeed uninitialised and the correct value to use is
res->start.

Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Bjorn Helgaas <helgaas@kernel.org>
Signed-off-by: default avatarMatt Fleming <matt@codeblueprint.co.uk>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent e298c499
...@@ -151,7 +151,7 @@ sn_io_slot_fixup(struct pci_dev *dev) ...@@ -151,7 +151,7 @@ sn_io_slot_fixup(struct pci_dev *dev)
{ {
int idx; int idx;
struct resource *res; struct resource *res;
unsigned long addr, size; unsigned long size;
struct pcidev_info *pcidev_info; struct pcidev_info *pcidev_info;
struct sn_irq_info *sn_irq_info; struct sn_irq_info *sn_irq_info;
int status; int status;
...@@ -186,7 +186,7 @@ sn_io_slot_fixup(struct pci_dev *dev) ...@@ -186,7 +186,7 @@ sn_io_slot_fixup(struct pci_dev *dev)
continue; continue;
res->start = pcidev_info->pdi_pio_mapped_addr[idx]; res->start = pcidev_info->pdi_pio_mapped_addr[idx];
res->end = addr + size; res->end = res->start + size;
/* /*
* if it's already in the device structure, remove it before * if it's already in the device structure, remove it before
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment