diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-01-01 11:40:50 -0500 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-02-22 19:16:57 -0500 |
commit | 3b7a17fcdae532d29dffab9d564a28be08960988 (patch) | |
tree | 64ac96e997751e34fcd237485fac9b868d1e0614 | |
parent | b26b2d494b659f988b4d75eb394dfa0ddac415c9 (diff) |
resource/PCI: mark struct resource as const
Now that we return the new resource start position, there is no
need to update "struct resource" inside the align function.
Therefore, mark the struct resource as const.
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
-rw-r--r-- | arch/alpha/kernel/pci.c | 2 | ||||
-rw-r--r-- | arch/arm/kernel/bios32.c | 2 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/pci/bios.c | 2 | ||||
-rw-r--r-- | arch/frv/mb93090-mb00/pci-frv.c | 2 | ||||
-rw-r--r-- | arch/ia64/pci/pci.c | 2 | ||||
-rw-r--r-- | arch/mips/pci/pci.c | 2 | ||||
-rw-r--r-- | arch/mips/pmc-sierra/yosemite/ht.c | 2 | ||||
-rw-r--r-- | arch/mn10300/unit-asb2305/pci-asb2305.c | 2 | ||||
-rw-r--r-- | arch/parisc/kernel/pci.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/pci-common.c | 2 | ||||
-rw-r--r-- | arch/sh/drivers/pci/pci.c | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/pci.c | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/pcic.c | 2 | ||||
-rw-r--r-- | arch/x86/pci/i386.c | 2 | ||||
-rw-r--r-- | arch/xtensa/kernel/pci.c | 4 | ||||
-rw-r--r-- | drivers/pci/bus.c | 2 | ||||
-rw-r--r-- | drivers/pcmcia/rsrc_mgr.c | 3 | ||||
-rw-r--r-- | drivers/pcmcia/rsrc_nonstatic.c | 6 | ||||
-rw-r--r-- | include/linux/ioport.h | 2 | ||||
-rw-r--r-- | include/linux/pci.h | 5 | ||||
-rw-r--r-- | kernel/resource.c | 4 |
21 files changed, 28 insertions, 26 deletions
diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c index 5cf111ed851c..c9ab94ee1ca8 100644 --- a/arch/alpha/kernel/pci.c +++ b/arch/alpha/kernel/pci.c | |||
@@ -127,7 +127,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_final); | |||
127 | #define GB (1024*MB) | 127 | #define GB (1024*MB) |
128 | 128 | ||
129 | resource_size_t | 129 | resource_size_t |
130 | pcibios_align_resource(void *data, struct resource *res, | 130 | pcibios_align_resource(void *data, const struct resource *res, |
131 | resource_size_t size, resource_size_t align) | 131 | resource_size_t size, resource_size_t align) |
132 | { | 132 | { |
133 | struct pci_dev *dev = data; | 133 | struct pci_dev *dev = data; |
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c index a7c85f84f06c..bd397e0b663e 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c | |||
@@ -616,7 +616,7 @@ char * __init pcibios_setup(char *str) | |||
616 | * but we want to try to avoid allocating at 0x2900-0x2bff | 616 | * but we want to try to avoid allocating at 0x2900-0x2bff |
617 | * which might be mirrored at 0x0100-0x03ff.. | 617 | * which might be mirrored at 0x0100-0x03ff.. |
618 | */ | 618 | */ |
619 | resource_size_t pcibios_align_resource(void *data, struct resource *res, | 619 | resource_size_t pcibios_align_resource(void *data, const struct resource *res, |
620 | resource_size_t size, resource_size_t align) | 620 | resource_size_t size, resource_size_t align) |
621 | { | 621 | { |
622 | resource_size_t start = res->start; | 622 | resource_size_t start = res->start; |
diff --git a/arch/cris/arch-v32/drivers/pci/bios.c b/arch/cris/arch-v32/drivers/pci/bios.c index 5811e2f8945c..d4b9c36ddc0f 100644 --- a/arch/cris/arch-v32/drivers/pci/bios.c +++ b/arch/cris/arch-v32/drivers/pci/bios.c | |||
@@ -42,7 +42,7 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | |||
42 | } | 42 | } |
43 | 43 | ||
44 | resource_size_t | 44 | resource_size_t |
45 | pcibios_align_resource(void *data, struct resource *res, | 45 | pcibios_align_resource(void *data, const struct resource *res, |
46 | resource_size_t size, resource_size_t align) | 46 | resource_size_t size, resource_size_t align) |
47 | { | 47 | { |
48 | resource_size_t start = res->start; | 48 | resource_size_t start = res->start; |
diff --git a/arch/frv/mb93090-mb00/pci-frv.c b/arch/frv/mb93090-mb00/pci-frv.c index c947aa43f2a9..1ed15d7fea20 100644 --- a/arch/frv/mb93090-mb00/pci-frv.c +++ b/arch/frv/mb93090-mb00/pci-frv.c | |||
@@ -33,7 +33,7 @@ | |||
33 | * which might have be mirrored at 0x0100-0x03ff.. | 33 | * which might have be mirrored at 0x0100-0x03ff.. |
34 | */ | 34 | */ |
35 | resource_size_t | 35 | resource_size_t |
36 | pcibios_align_resource(void *data, struct resource *res, | 36 | pcibios_align_resource(void *data, const struct resource *res, |
37 | resource_size_t size, resource_size_t align) | 37 | resource_size_t size, resource_size_t align) |
38 | { | 38 | { |
39 | resource_size_t start = res->start; | 39 | resource_size_t start = res->start; |
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index ef574cd311d1..783c83bb2b49 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c | |||
@@ -548,7 +548,7 @@ pcibios_disable_device (struct pci_dev *dev) | |||
548 | } | 548 | } |
549 | 549 | ||
550 | resource_size_t | 550 | resource_size_t |
551 | pcibios_align_resource (void *data, struct resource *res, | 551 | pcibios_align_resource (void *data, const struct resource *res, |
552 | resource_size_t size, resource_size_t align) | 552 | resource_size_t size, resource_size_t align) |
553 | { | 553 | { |
554 | return res->start; | 554 | return res->start; |
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c index 9085988f7cf3..f87f5e188fa6 100644 --- a/arch/mips/pci/pci.c +++ b/arch/mips/pci/pci.c | |||
@@ -50,7 +50,7 @@ static int pci_initialized; | |||
50 | * which might have be mirrored at 0x0100-0x03ff.. | 50 | * which might have be mirrored at 0x0100-0x03ff.. |
51 | */ | 51 | */ |
52 | resource_size_t | 52 | resource_size_t |
53 | pcibios_align_resource(void *data, struct resource *res, | 53 | pcibios_align_resource(void *data, const struct resource *res, |
54 | resource_size_t size, resource_size_t align) | 54 | resource_size_t size, resource_size_t align) |
55 | { | 55 | { |
56 | struct pci_dev *dev = data; | 56 | struct pci_dev *dev = data; |
diff --git a/arch/mips/pmc-sierra/yosemite/ht.c b/arch/mips/pmc-sierra/yosemite/ht.c index 5e410087b628..fd22597edb64 100644 --- a/arch/mips/pmc-sierra/yosemite/ht.c +++ b/arch/mips/pmc-sierra/yosemite/ht.c | |||
@@ -345,7 +345,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) | |||
345 | return pcibios_enable_resources(dev); | 345 | return pcibios_enable_resources(dev); |
346 | } | 346 | } |
347 | 347 | ||
348 | resource_size_t pcibios_align_resource(void *data, struct resource *res, | 348 | resource_size_t pcibios_align_resource(void *data, const struct resource *res, |
349 | resource_size_t size, resource_size_t align) | 349 | resource_size_t size, resource_size_t align) |
350 | { | 350 | { |
351 | struct pci_dev *dev = data; | 351 | struct pci_dev *dev = data; |
diff --git a/arch/mn10300/unit-asb2305/pci-asb2305.c b/arch/mn10300/unit-asb2305/pci-asb2305.c index b0b3758fba08..d6119b879a98 100644 --- a/arch/mn10300/unit-asb2305/pci-asb2305.c +++ b/arch/mn10300/unit-asb2305/pci-asb2305.c | |||
@@ -31,7 +31,7 @@ | |||
31 | * but we want to try to avoid allocating at 0x2900-0x2bff | 31 | * but we want to try to avoid allocating at 0x2900-0x2bff |
32 | * which might have be mirrored at 0x0100-0x03ff.. | 32 | * which might have be mirrored at 0x0100-0x03ff.. |
33 | */ | 33 | */ |
34 | resource_size_t pcibios_align_resource(void *data, struct resource *res, | 34 | resource_size_t pcibios_align_resource(void *data, const struct resource *res, |
35 | resource_size_t size, resource_size_t align) | 35 | resource_size_t size, resource_size_t align) |
36 | { | 36 | { |
37 | resource_size_t start = res->start; | 37 | resource_size_t start = res->start; |
diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c index 4463a31973ba..5179e5e6f8fb 100644 --- a/arch/parisc/kernel/pci.c +++ b/arch/parisc/kernel/pci.c | |||
@@ -254,7 +254,7 @@ EXPORT_SYMBOL(pcibios_bus_to_resource); | |||
254 | * Since we are just checking candidates, don't use any fields other | 254 | * Since we are just checking candidates, don't use any fields other |
255 | * than res->start. | 255 | * than res->start. |
256 | */ | 256 | */ |
257 | resource_size_t pcibios_align_resource(void *data, struct resource *res, | 257 | resource_size_t pcibios_align_resource(void *data, const struct resource *res, |
258 | resource_size_t size, resource_size_t alignment) | 258 | resource_size_t size, resource_size_t alignment) |
259 | { | 259 | { |
260 | resource_size_t mask, align, start = res->start; | 260 | resource_size_t mask, align, start = res->start; |
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index d7eebbaf01f1..e640810e813f 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
@@ -1181,7 +1181,7 @@ static int skip_isa_ioresource_align(struct pci_dev *dev) | |||
1181 | * but we want to try to avoid allocating at 0x2900-0x2bff | 1181 | * but we want to try to avoid allocating at 0x2900-0x2bff |
1182 | * which might have be mirrored at 0x0100-0x03ff.. | 1182 | * which might have be mirrored at 0x0100-0x03ff.. |
1183 | */ | 1183 | */ |
1184 | resource_size_t pcibios_align_resource(void *data, struct resource *res, | 1184 | resource_size_t pcibios_align_resource(void *data, const struct resource *res, |
1185 | resource_size_t size, resource_size_t align) | 1185 | resource_size_t size, resource_size_t align) |
1186 | { | 1186 | { |
1187 | struct pci_dev *dev = data; | 1187 | struct pci_dev *dev = data; |
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c index b36ca825b3d3..96213fd172ce 100644 --- a/arch/sh/drivers/pci/pci.c +++ b/arch/sh/drivers/pci/pci.c | |||
@@ -148,7 +148,7 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus) | |||
148 | * addresses to be allocated in the 0x000-0x0ff region | 148 | * addresses to be allocated in the 0x000-0x0ff region |
149 | * modulo 0x400. | 149 | * modulo 0x400. |
150 | */ | 150 | */ |
151 | resource_size_t pcibios_align_resource(void *data, struct resource *res, | 151 | resource_size_t pcibios_align_resource(void *data, const struct resource *res, |
152 | resource_size_t size, resource_size_t align) | 152 | resource_size_t size, resource_size_t align) |
153 | { | 153 | { |
154 | struct pci_dev *dev = data; | 154 | struct pci_dev *dev = data; |
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c index d56c1f34689e..37b66c60abe3 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c | |||
@@ -722,7 +722,7 @@ void pcibios_update_irq(struct pci_dev *pdev, int irq) | |||
722 | { | 722 | { |
723 | } | 723 | } |
724 | 724 | ||
725 | resource_size_t pcibios_align_resource(void *data, struct resource *res, | 725 | resource_size_t pcibios_align_resource(void *data, const struct resource *res, |
726 | resource_size_t size, resource_size_t align) | 726 | resource_size_t size, resource_size_t align) |
727 | { | 727 | { |
728 | return res->start; | 728 | return res->start; |
diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c index 46fda64ff163..75e88c00bca3 100644 --- a/arch/sparc/kernel/pcic.c +++ b/arch/sparc/kernel/pcic.c | |||
@@ -768,7 +768,7 @@ char * __devinit pcibios_setup(char *str) | |||
768 | return str; | 768 | return str; |
769 | } | 769 | } |
770 | 770 | ||
771 | resource_size_t pcibios_align_resource(void *data, struct resource *res, | 771 | resource_size_t pcibios_align_resource(void *data, const struct resource *res, |
772 | resource_size_t size, resource_size_t align) | 772 | resource_size_t size, resource_size_t align) |
773 | { | 773 | { |
774 | return res->start; | 774 | return res->start; |
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c index 924e40c916d3..5a8fbf8d4cac 100644 --- a/arch/x86/pci/i386.c +++ b/arch/x86/pci/i386.c | |||
@@ -61,7 +61,7 @@ skip_isa_ioresource_align(struct pci_dev *dev) { | |||
61 | * which might have be mirrored at 0x0100-0x03ff.. | 61 | * which might have be mirrored at 0x0100-0x03ff.. |
62 | */ | 62 | */ |
63 | resource_size_t | 63 | resource_size_t |
64 | pcibios_align_resource(void *data, struct resource *res, | 64 | pcibios_align_resource(void *data, const struct resource *res, |
65 | resource_size_t size, resource_size_t align) | 65 | resource_size_t size, resource_size_t align) |
66 | { | 66 | { |
67 | struct pci_dev *dev = data; | 67 | struct pci_dev *dev = data; |
diff --git a/arch/xtensa/kernel/pci.c b/arch/xtensa/kernel/pci.c index d7efab03164e..cd1026931203 100644 --- a/arch/xtensa/kernel/pci.c +++ b/arch/xtensa/kernel/pci.c | |||
@@ -70,8 +70,8 @@ static int pci_bus_count; | |||
70 | * which might have be mirrored at 0x0100-0x03ff.. | 70 | * which might have be mirrored at 0x0100-0x03ff.. |
71 | */ | 71 | */ |
72 | resource_size_t | 72 | resource_size_t |
73 | pcibios_align_resource(void *data, struct resource *res, resource_size_t size, | 73 | pcibios_align_resource(void *data, const struct resource *res, |
74 | resource_size_t align) | 74 | resource_size_t size, resource_size_t align) |
75 | { | 75 | { |
76 | struct pci_dev *dev = data; | 76 | struct pci_dev *dev = data; |
77 | resource_size_t start = res->start; | 77 | resource_size_t start = res->start; |
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index d29d69a37940..a26135bb0ffd 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c | |||
@@ -37,7 +37,7 @@ pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, | |||
37 | resource_size_t size, resource_size_t align, | 37 | resource_size_t size, resource_size_t align, |
38 | resource_size_t min, unsigned int type_mask, | 38 | resource_size_t min, unsigned int type_mask, |
39 | resource_size_t (*alignf)(void *, | 39 | resource_size_t (*alignf)(void *, |
40 | struct resource *, | 40 | const struct resource *, |
41 | resource_size_t, | 41 | resource_size_t, |
42 | resource_size_t), | 42 | resource_size_t), |
43 | void *alignf_data) | 43 | void *alignf_data) |
diff --git a/drivers/pcmcia/rsrc_mgr.c b/drivers/pcmcia/rsrc_mgr.c index f92a2dac13a2..f8401a0ef89b 100644 --- a/drivers/pcmcia/rsrc_mgr.c +++ b/drivers/pcmcia/rsrc_mgr.c | |||
@@ -114,7 +114,8 @@ struct pcmcia_align_data { | |||
114 | unsigned long offset; | 114 | unsigned long offset; |
115 | }; | 115 | }; |
116 | 116 | ||
117 | static resource_size_t pcmcia_align(void *align_data, struct resource *res, | 117 | static resource_size_t pcmcia_align(void *align_data, |
118 | const struct resource *res, | ||
118 | resource_size_t size, resource_size_t align) | 119 | resource_size_t size, resource_size_t align) |
119 | { | 120 | { |
120 | struct pcmcia_align_data *data = align_data; | 121 | struct pcmcia_align_data *data = align_data; |
diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c index b65902870e44..45d75dc452f0 100644 --- a/drivers/pcmcia/rsrc_nonstatic.c +++ b/drivers/pcmcia/rsrc_nonstatic.c | |||
@@ -534,7 +534,7 @@ struct pcmcia_align_data { | |||
534 | }; | 534 | }; |
535 | 535 | ||
536 | static resource_size_t | 536 | static resource_size_t |
537 | pcmcia_common_align(void *align_data, struct resource *res, | 537 | pcmcia_common_align(void *align_data, const struct resource *res, |
538 | resource_size_t size, resource_size_t align) | 538 | resource_size_t size, resource_size_t align) |
539 | { | 539 | { |
540 | struct pcmcia_align_data *data = align_data; | 540 | struct pcmcia_align_data *data = align_data; |
@@ -549,8 +549,8 @@ pcmcia_common_align(void *align_data, struct resource *res, | |||
549 | } | 549 | } |
550 | 550 | ||
551 | static resource_size_t | 551 | static resource_size_t |
552 | pcmcia_align(void *align_data, struct resource *res, resource_size_t size, | 552 | pcmcia_align(void *align_data, const struct resource *res, |
553 | resource_size_t align) | 553 | resource_size_t size, resource_size_t align) |
554 | { | 554 | { |
555 | struct pcmcia_align_data *data = align_data; | 555 | struct pcmcia_align_data *data = align_data; |
556 | struct resource_map *m; | 556 | struct resource_map *m; |
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index f4195de4eb9d..4a811891dbe3 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -121,7 +121,7 @@ extern int allocate_resource(struct resource *root, struct resource *new, | |||
121 | resource_size_t size, resource_size_t min, | 121 | resource_size_t size, resource_size_t min, |
122 | resource_size_t max, resource_size_t align, | 122 | resource_size_t max, resource_size_t align, |
123 | resource_size_t (*alignf)(void *, | 123 | resource_size_t (*alignf)(void *, |
124 | struct resource *, | 124 | const struct resource *, |
125 | resource_size_t, | 125 | resource_size_t, |
126 | resource_size_t), | 126 | resource_size_t), |
127 | void *alignf_data); | 127 | void *alignf_data); |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 1bd9f52b24b8..449d51560fc2 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -592,7 +592,7 @@ int __must_check pcibios_enable_device(struct pci_dev *, int mask); | |||
592 | char *pcibios_setup(char *str); | 592 | char *pcibios_setup(char *str); |
593 | 593 | ||
594 | /* Used only when drivers/pci/setup.c is used */ | 594 | /* Used only when drivers/pci/setup.c is used */ |
595 | resource_size_t pcibios_align_resource(void *, struct resource *, | 595 | resource_size_t pcibios_align_resource(void *, const struct resource *, |
596 | resource_size_t, | 596 | resource_size_t, |
597 | resource_size_t); | 597 | resource_size_t); |
598 | void pcibios_update_irq(struct pci_dev *, int irq); | 598 | void pcibios_update_irq(struct pci_dev *, int irq); |
@@ -828,7 +828,8 @@ int __must_check pci_bus_alloc_resource(struct pci_bus *bus, | |||
828 | struct resource *res, resource_size_t size, | 828 | struct resource *res, resource_size_t size, |
829 | resource_size_t align, resource_size_t min, | 829 | resource_size_t align, resource_size_t min, |
830 | unsigned int type_mask, | 830 | unsigned int type_mask, |
831 | resource_size_t (*alignf)(void *, struct resource *, | 831 | resource_size_t (*alignf)(void *, |
832 | const struct resource *, | ||
832 | resource_size_t, | 833 | resource_size_t, |
833 | resource_size_t), | 834 | resource_size_t), |
834 | void *alignf_data); | 835 | void *alignf_data); |
diff --git a/kernel/resource.c b/kernel/resource.c index e697f20e2288..7fd123ad00aa 100644 --- a/kernel/resource.c +++ b/kernel/resource.c | |||
@@ -304,7 +304,7 @@ static int find_resource(struct resource *root, struct resource *new, | |||
304 | resource_size_t size, resource_size_t min, | 304 | resource_size_t size, resource_size_t min, |
305 | resource_size_t max, resource_size_t align, | 305 | resource_size_t max, resource_size_t align, |
306 | resource_size_t (*alignf)(void *, | 306 | resource_size_t (*alignf)(void *, |
307 | struct resource *, | 307 | const struct resource *, |
308 | resource_size_t, | 308 | resource_size_t, |
309 | resource_size_t), | 309 | resource_size_t), |
310 | void *alignf_data) | 310 | void *alignf_data) |
@@ -361,7 +361,7 @@ int allocate_resource(struct resource *root, struct resource *new, | |||
361 | resource_size_t size, resource_size_t min, | 361 | resource_size_t size, resource_size_t min, |
362 | resource_size_t max, resource_size_t align, | 362 | resource_size_t max, resource_size_t align, |
363 | resource_size_t (*alignf)(void *, | 363 | resource_size_t (*alignf)(void *, |
364 | struct resource *, | 364 | const struct resource *, |
365 | resource_size_t, | 365 | resource_size_t, |
366 | resource_size_t), | 366 | resource_size_t), |
367 | void *alignf_data) | 367 | void *alignf_data) |