diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-04-29 03:59:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 11:06:02 -0400 |
commit | b70d3a2c596fb52b02488ad4aef13fa0d602090c (patch) | |
tree | 502793fdd2ca7c7e0d66af3e750d4ffbec6db248 /arch | |
parent | 626adeb6675fdf60e9d8c6212776b0b0acf0e376 (diff) |
iomap: fix 64 bits resources on 32 bits
Almost all implementations of pci_iomap() in the kernel, including the generic
lib/iomap.c one, copies the content of a struct resource into unsigned long's
which will break on 32 bits platforms with 64 bits resources.
This fixes all definitions of pci_iomap() to use resource_size_t. I also
"fixed" the 64bits arch for consistency.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/alpha/kernel/pci.c | 4 | ||||
-rw-r--r-- | arch/arm/mm/iomap.c | 4 | ||||
-rw-r--r-- | arch/frv/mb93090-mb00/pci-iomap.c | 4 | ||||
-rw-r--r-- | arch/mips/lib/iomap-pci.c | 4 | ||||
-rw-r--r-- | arch/mn10300/unit-asb2305/pci-iomap.c | 4 | ||||
-rw-r--r-- | arch/parisc/lib/iomap.c | 4 | ||||
-rw-r--r-- | arch/ppc/kernel/pci.c | 4 | ||||
-rw-r--r-- | arch/sh/drivers/pci/pci.c | 4 | ||||
-rw-r--r-- | arch/sparc/lib/iomap.c | 4 | ||||
-rw-r--r-- | arch/sparc64/lib/iomap.c | 4 | ||||
-rw-r--r-- | arch/v850/kernel/rte_mb_a_pci.c | 4 |
11 files changed, 22 insertions, 22 deletions
diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c index baf57563b14c..36ab22a7ea12 100644 --- a/arch/alpha/kernel/pci.c +++ b/arch/alpha/kernel/pci.c | |||
@@ -514,8 +514,8 @@ sys_pciconfig_iobase(long which, unsigned long bus, unsigned long dfn) | |||
514 | 514 | ||
515 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) | 515 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) |
516 | { | 516 | { |
517 | unsigned long start = pci_resource_start(dev, bar); | 517 | resource_size_t start = pci_resource_start(dev, bar); |
518 | unsigned long len = pci_resource_len(dev, bar); | 518 | resource_size_t len = pci_resource_len(dev, bar); |
519 | unsigned long flags = pci_resource_flags(dev, bar); | 519 | unsigned long flags = pci_resource_flags(dev, bar); |
520 | 520 | ||
521 | if (!len || !start) | 521 | if (!len || !start) |
diff --git a/arch/arm/mm/iomap.c b/arch/arm/mm/iomap.c index 62066f3020c8..7429f8c01015 100644 --- a/arch/arm/mm/iomap.c +++ b/arch/arm/mm/iomap.c | |||
@@ -26,8 +26,8 @@ EXPORT_SYMBOL(ioport_unmap); | |||
26 | #ifdef CONFIG_PCI | 26 | #ifdef CONFIG_PCI |
27 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) | 27 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) |
28 | { | 28 | { |
29 | unsigned long start = pci_resource_start(dev, bar); | 29 | resource_size_t start = pci_resource_start(dev, bar); |
30 | unsigned long len = pci_resource_len(dev, bar); | 30 | resource_size_t len = pci_resource_len(dev, bar); |
31 | unsigned long flags = pci_resource_flags(dev, bar); | 31 | unsigned long flags = pci_resource_flags(dev, bar); |
32 | 32 | ||
33 | if (!len || !start) | 33 | if (!len || !start) |
diff --git a/arch/frv/mb93090-mb00/pci-iomap.c b/arch/frv/mb93090-mb00/pci-iomap.c index 068fa04bd527..35f6df28351e 100644 --- a/arch/frv/mb93090-mb00/pci-iomap.c +++ b/arch/frv/mb93090-mb00/pci-iomap.c | |||
@@ -13,8 +13,8 @@ | |||
13 | 13 | ||
14 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) | 14 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) |
15 | { | 15 | { |
16 | unsigned long start = pci_resource_start(dev, bar); | 16 | resource_size_t start = pci_resource_start(dev, bar); |
17 | unsigned long len = pci_resource_len(dev, bar); | 17 | resource_size_t len = pci_resource_len(dev, bar); |
18 | unsigned long flags = pci_resource_flags(dev, bar); | 18 | unsigned long flags = pci_resource_flags(dev, bar); |
19 | 19 | ||
20 | if (!len || !start) | 20 | if (!len || !start) |
diff --git a/arch/mips/lib/iomap-pci.c b/arch/mips/lib/iomap-pci.c index c11b2494bb6e..2ab899c4b4ce 100644 --- a/arch/mips/lib/iomap-pci.c +++ b/arch/mips/lib/iomap-pci.c | |||
@@ -45,8 +45,8 @@ static void __iomem *ioport_map_pci(struct pci_dev *dev, | |||
45 | */ | 45 | */ |
46 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) | 46 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) |
47 | { | 47 | { |
48 | unsigned long start = pci_resource_start(dev, bar); | 48 | resource_size_t start = pci_resource_start(dev, bar); |
49 | unsigned long len = pci_resource_len(dev, bar); | 49 | resource_size_t len = pci_resource_len(dev, bar); |
50 | unsigned long flags = pci_resource_flags(dev, bar); | 50 | unsigned long flags = pci_resource_flags(dev, bar); |
51 | 51 | ||
52 | if (!len || !start) | 52 | if (!len || !start) |
diff --git a/arch/mn10300/unit-asb2305/pci-iomap.c b/arch/mn10300/unit-asb2305/pci-iomap.c index dbceae4307da..c1a8d8f941fd 100644 --- a/arch/mn10300/unit-asb2305/pci-iomap.c +++ b/arch/mn10300/unit-asb2305/pci-iomap.c | |||
@@ -16,8 +16,8 @@ | |||
16 | */ | 16 | */ |
17 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) | 17 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) |
18 | { | 18 | { |
19 | unsigned long start = pci_resource_start(dev, bar); | 19 | resource_size_t start = pci_resource_start(dev, bar); |
20 | unsigned long len = pci_resource_len(dev, bar); | 20 | resource_size_t len = pci_resource_len(dev, bar); |
21 | unsigned long flags = pci_resource_flags(dev, bar); | 21 | unsigned long flags = pci_resource_flags(dev, bar); |
22 | 22 | ||
23 | if (!len || !start) | 23 | if (!len || !start) |
diff --git a/arch/parisc/lib/iomap.c b/arch/parisc/lib/iomap.c index f4a811690ab3..9abed07db7fc 100644 --- a/arch/parisc/lib/iomap.c +++ b/arch/parisc/lib/iomap.c | |||
@@ -438,8 +438,8 @@ void ioport_unmap(void __iomem *addr) | |||
438 | /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ | 438 | /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ |
439 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) | 439 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) |
440 | { | 440 | { |
441 | unsigned long start = pci_resource_start(dev, bar); | 441 | resource_size_t start = pci_resource_start(dev, bar); |
442 | unsigned long len = pci_resource_len(dev, bar); | 442 | resource_size_t len = pci_resource_len(dev, bar); |
443 | unsigned long flags = pci_resource_flags(dev, bar); | 443 | unsigned long flags = pci_resource_flags(dev, bar); |
444 | 444 | ||
445 | if (!len || !start) | 445 | if (!len || !start) |
diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c index 50ce83f20adb..df3ef6db072c 100644 --- a/arch/ppc/kernel/pci.c +++ b/arch/ppc/kernel/pci.c | |||
@@ -1121,8 +1121,8 @@ void __init pci_init_resource(struct resource *res, resource_size_t start, | |||
1121 | 1121 | ||
1122 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) | 1122 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) |
1123 | { | 1123 | { |
1124 | unsigned long start = pci_resource_start(dev, bar); | 1124 | resource_size_t start = pci_resource_start(dev, bar); |
1125 | unsigned long len = pci_resource_len(dev, bar); | 1125 | resource_size_t len = pci_resource_len(dev, bar); |
1126 | unsigned long flags = pci_resource_flags(dev, bar); | 1126 | unsigned long flags = pci_resource_flags(dev, bar); |
1127 | 1127 | ||
1128 | if (!len) | 1128 | if (!len) |
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c index 49b435c3a57a..08d2e7325252 100644 --- a/arch/sh/drivers/pci/pci.c +++ b/arch/sh/drivers/pci/pci.c | |||
@@ -191,8 +191,8 @@ void __init pcibios_update_irq(struct pci_dev *dev, int irq) | |||
191 | 191 | ||
192 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) | 192 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) |
193 | { | 193 | { |
194 | unsigned long start = pci_resource_start(dev, bar); | 194 | resource_size_t start = pci_resource_start(dev, bar); |
195 | unsigned long len = pci_resource_len(dev, bar); | 195 | resource_size_t len = pci_resource_len(dev, bar); |
196 | unsigned long flags = pci_resource_flags(dev, bar); | 196 | unsigned long flags = pci_resource_flags(dev, bar); |
197 | 197 | ||
198 | if (unlikely(!len || !start)) | 198 | if (unlikely(!len || !start)) |
diff --git a/arch/sparc/lib/iomap.c b/arch/sparc/lib/iomap.c index 54501c1ca785..9ef37e13a920 100644 --- a/arch/sparc/lib/iomap.c +++ b/arch/sparc/lib/iomap.c | |||
@@ -21,8 +21,8 @@ EXPORT_SYMBOL(ioport_unmap); | |||
21 | /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ | 21 | /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ |
22 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) | 22 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) |
23 | { | 23 | { |
24 | unsigned long start = pci_resource_start(dev, bar); | 24 | resource_size_t start = pci_resource_start(dev, bar); |
25 | unsigned long len = pci_resource_len(dev, bar); | 25 | resource_size_t len = pci_resource_len(dev, bar); |
26 | unsigned long flags = pci_resource_flags(dev, bar); | 26 | unsigned long flags = pci_resource_flags(dev, bar); |
27 | 27 | ||
28 | if (!len || !start) | 28 | if (!len || !start) |
diff --git a/arch/sparc64/lib/iomap.c b/arch/sparc64/lib/iomap.c index ac556db06973..7120ebbd4d03 100644 --- a/arch/sparc64/lib/iomap.c +++ b/arch/sparc64/lib/iomap.c | |||
@@ -21,8 +21,8 @@ EXPORT_SYMBOL(ioport_unmap); | |||
21 | /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ | 21 | /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ |
22 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) | 22 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) |
23 | { | 23 | { |
24 | unsigned long start = pci_resource_start(dev, bar); | 24 | resource_size_t start = pci_resource_start(dev, bar); |
25 | unsigned long len = pci_resource_len(dev, bar); | 25 | resource_size_t len = pci_resource_len(dev, bar); |
26 | unsigned long flags = pci_resource_flags(dev, bar); | 26 | unsigned long flags = pci_resource_flags(dev, bar); |
27 | 27 | ||
28 | if (!len || !start) | 28 | if (!len || !start) |
diff --git a/arch/v850/kernel/rte_mb_a_pci.c b/arch/v850/kernel/rte_mb_a_pci.c index 7165478824e7..687e367d8b64 100644 --- a/arch/v850/kernel/rte_mb_a_pci.c +++ b/arch/v850/kernel/rte_mb_a_pci.c | |||
@@ -790,8 +790,8 @@ pci_free_consistent (struct pci_dev *pdev, size_t size, void *cpu_addr, | |||
790 | 790 | ||
791 | void __iomem *pci_iomap (struct pci_dev *dev, int bar, unsigned long max) | 791 | void __iomem *pci_iomap (struct pci_dev *dev, int bar, unsigned long max) |
792 | { | 792 | { |
793 | unsigned long start = pci_resource_start (dev, bar); | 793 | resource_size_t start = pci_resource_start (dev, bar); |
794 | unsigned long len = pci_resource_len (dev, bar); | 794 | resource_size_t len = pci_resource_len (dev, bar); |
795 | 795 | ||
796 | if (!start || len == 0) | 796 | if (!start || len == 0) |
797 | return 0; | 797 | return 0; |