Skip to content

Commit

Permalink
ia64/PCI: Fix incorrect PCI resource end address
Browse files Browse the repository at this point in the history
commit f976721 ("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 <[email protected]>
Cc: Fenghua Yu <[email protected]>
Cc: Bjorn Helgaas <[email protected]>
Signed-off-by: Matt Fleming <[email protected]>
Signed-off-by: Tony Luck <[email protected]>
  • Loading branch information
mfleming authored and aegl committed May 5, 2016
1 parent e298c49 commit 18c2552
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/ia64/sn/kernel/io_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ sn_io_slot_fixup(struct pci_dev *dev)
{
int idx;
struct resource *res;
unsigned long addr, size;
unsigned long size;
struct pcidev_info *pcidev_info;
struct sn_irq_info *sn_irq_info;
int status;
Expand Down Expand Up @@ -186,7 +186,7 @@ sn_io_slot_fixup(struct pci_dev *dev)
continue;

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
Expand Down

0 comments on commit 18c2552

Please sign in to comment.