Commit 3b7a17fc authored by Dominik Brodowski's avatar Dominik Brodowski Committed by Jesse Barnes

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: default avatarDominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent b26b2d49
...@@ -127,7 +127,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_final); ...@@ -127,7 +127,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_final);
#define GB (1024*MB) #define GB (1024*MB)
resource_size_t resource_size_t
pcibios_align_resource(void *data, struct resource *res, pcibios_align_resource(void *data, const struct resource *res,
resource_size_t size, resource_size_t align) resource_size_t size, resource_size_t align)
{ {
struct pci_dev *dev = data; struct pci_dev *dev = data;
......
...@@ -616,7 +616,7 @@ char * __init pcibios_setup(char *str) ...@@ -616,7 +616,7 @@ char * __init pcibios_setup(char *str)
* but we want to try to avoid allocating at 0x2900-0x2bff * but we want to try to avoid allocating at 0x2900-0x2bff
* which might be mirrored at 0x0100-0x03ff.. * which might be mirrored at 0x0100-0x03ff..
*/ */
resource_size_t pcibios_align_resource(void *data, struct resource *res, resource_size_t pcibios_align_resource(void *data, const struct resource *res,
resource_size_t size, resource_size_t align) resource_size_t size, resource_size_t align)
{ {
resource_size_t start = res->start; resource_size_t start = res->start;
......
...@@ -42,7 +42,7 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, ...@@ -42,7 +42,7 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
} }
resource_size_t resource_size_t
pcibios_align_resource(void *data, struct resource *res, pcibios_align_resource(void *data, const struct resource *res,
resource_size_t size, resource_size_t align) resource_size_t size, resource_size_t align)
{ {
resource_size_t start = res->start; resource_size_t start = res->start;
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
* which might have be mirrored at 0x0100-0x03ff.. * which might have be mirrored at 0x0100-0x03ff..
*/ */
resource_size_t resource_size_t
pcibios_align_resource(void *data, struct resource *res, pcibios_align_resource(void *data, const struct resource *res,
resource_size_t size, resource_size_t align) resource_size_t size, resource_size_t align)
{ {
resource_size_t start = res->start; resource_size_t start = res->start;
......
...@@ -548,7 +548,7 @@ pcibios_disable_device (struct pci_dev *dev) ...@@ -548,7 +548,7 @@ pcibios_disable_device (struct pci_dev *dev)
} }
resource_size_t resource_size_t
pcibios_align_resource (void *data, struct resource *res, pcibios_align_resource (void *data, const struct resource *res,
resource_size_t size, resource_size_t align) resource_size_t size, resource_size_t align)
{ {
return res->start; return res->start;
......
...@@ -50,7 +50,7 @@ static int pci_initialized; ...@@ -50,7 +50,7 @@ static int pci_initialized;
* which might have be mirrored at 0x0100-0x03ff.. * which might have be mirrored at 0x0100-0x03ff..
*/ */
resource_size_t resource_size_t
pcibios_align_resource(void *data, struct resource *res, pcibios_align_resource(void *data, const struct resource *res,
resource_size_t size, resource_size_t align) resource_size_t size, resource_size_t align)
{ {
struct pci_dev *dev = data; struct pci_dev *dev = data;
......
...@@ -345,7 +345,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) ...@@ -345,7 +345,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
return pcibios_enable_resources(dev); return pcibios_enable_resources(dev);
} }
resource_size_t pcibios_align_resource(void *data, struct resource *res, resource_size_t pcibios_align_resource(void *data, const struct resource *res,
resource_size_t size, resource_size_t align) resource_size_t size, resource_size_t align)
{ {
struct pci_dev *dev = data; struct pci_dev *dev = data;
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
* but we want to try to avoid allocating at 0x2900-0x2bff * but we want to try to avoid allocating at 0x2900-0x2bff
* which might have be mirrored at 0x0100-0x03ff.. * which might have be mirrored at 0x0100-0x03ff..
*/ */
resource_size_t pcibios_align_resource(void *data, struct resource *res, resource_size_t pcibios_align_resource(void *data, const struct resource *res,
resource_size_t size, resource_size_t align) resource_size_t size, resource_size_t align)
{ {
resource_size_t start = res->start; resource_size_t start = res->start;
......
...@@ -254,7 +254,7 @@ EXPORT_SYMBOL(pcibios_bus_to_resource); ...@@ -254,7 +254,7 @@ EXPORT_SYMBOL(pcibios_bus_to_resource);
* Since we are just checking candidates, don't use any fields other * Since we are just checking candidates, don't use any fields other
* than res->start. * than res->start.
*/ */
resource_size_t pcibios_align_resource(void *data, struct resource *res, resource_size_t pcibios_align_resource(void *data, const struct resource *res,
resource_size_t size, resource_size_t alignment) resource_size_t size, resource_size_t alignment)
{ {
resource_size_t mask, align, start = res->start; resource_size_t mask, align, start = res->start;
......
...@@ -1181,7 +1181,7 @@ static int skip_isa_ioresource_align(struct pci_dev *dev) ...@@ -1181,7 +1181,7 @@ static int skip_isa_ioresource_align(struct pci_dev *dev)
* but we want to try to avoid allocating at 0x2900-0x2bff * but we want to try to avoid allocating at 0x2900-0x2bff
* which might have be mirrored at 0x0100-0x03ff.. * which might have be mirrored at 0x0100-0x03ff..
*/ */
resource_size_t pcibios_align_resource(void *data, struct resource *res, resource_size_t pcibios_align_resource(void *data, const struct resource *res,
resource_size_t size, resource_size_t align) resource_size_t size, resource_size_t align)
{ {
struct pci_dev *dev = data; struct pci_dev *dev = data;
......
...@@ -148,7 +148,7 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus) ...@@ -148,7 +148,7 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
* addresses to be allocated in the 0x000-0x0ff region * addresses to be allocated in the 0x000-0x0ff region
* modulo 0x400. * modulo 0x400.
*/ */
resource_size_t pcibios_align_resource(void *data, struct resource *res, resource_size_t pcibios_align_resource(void *data, const struct resource *res,
resource_size_t size, resource_size_t align) resource_size_t size, resource_size_t align)
{ {
struct pci_dev *dev = data; struct pci_dev *dev = data;
......
...@@ -722,7 +722,7 @@ void pcibios_update_irq(struct pci_dev *pdev, int irq) ...@@ -722,7 +722,7 @@ void pcibios_update_irq(struct pci_dev *pdev, int irq)
{ {
} }
resource_size_t pcibios_align_resource(void *data, struct resource *res, resource_size_t pcibios_align_resource(void *data, const struct resource *res,
resource_size_t size, resource_size_t align) resource_size_t size, resource_size_t align)
{ {
return res->start; return res->start;
......
...@@ -768,7 +768,7 @@ char * __devinit pcibios_setup(char *str) ...@@ -768,7 +768,7 @@ char * __devinit pcibios_setup(char *str)
return str; return str;
} }
resource_size_t pcibios_align_resource(void *data, struct resource *res, resource_size_t pcibios_align_resource(void *data, const struct resource *res,
resource_size_t size, resource_size_t align) resource_size_t size, resource_size_t align)
{ {
return res->start; return res->start;
......
...@@ -61,7 +61,7 @@ skip_isa_ioresource_align(struct pci_dev *dev) { ...@@ -61,7 +61,7 @@ skip_isa_ioresource_align(struct pci_dev *dev) {
* which might have be mirrored at 0x0100-0x03ff.. * which might have be mirrored at 0x0100-0x03ff..
*/ */
resource_size_t resource_size_t
pcibios_align_resource(void *data, struct resource *res, pcibios_align_resource(void *data, const struct resource *res,
resource_size_t size, resource_size_t align) resource_size_t size, resource_size_t align)
{ {
struct pci_dev *dev = data; struct pci_dev *dev = data;
......
...@@ -70,8 +70,8 @@ static int pci_bus_count; ...@@ -70,8 +70,8 @@ static int pci_bus_count;
* which might have be mirrored at 0x0100-0x03ff.. * which might have be mirrored at 0x0100-0x03ff..
*/ */
resource_size_t resource_size_t
pcibios_align_resource(void *data, struct resource *res, resource_size_t size, pcibios_align_resource(void *data, const struct resource *res,
resource_size_t align) resource_size_t size, resource_size_t align)
{ {
struct pci_dev *dev = data; struct pci_dev *dev = data;
resource_size_t start = res->start; resource_size_t start = res->start;
......
...@@ -37,7 +37,7 @@ pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, ...@@ -37,7 +37,7 @@ pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res,
resource_size_t size, resource_size_t align, resource_size_t size, resource_size_t align,
resource_size_t min, unsigned int type_mask, resource_size_t min, unsigned int type_mask,
resource_size_t (*alignf)(void *, resource_size_t (*alignf)(void *,
struct resource *, const struct resource *,
resource_size_t, resource_size_t,
resource_size_t), resource_size_t),
void *alignf_data) void *alignf_data)
......
...@@ -114,7 +114,8 @@ struct pcmcia_align_data { ...@@ -114,7 +114,8 @@ struct pcmcia_align_data {
unsigned long offset; unsigned long offset;
}; };
static resource_size_t pcmcia_align(void *align_data, struct resource *res, static resource_size_t pcmcia_align(void *align_data,
const struct resource *res,
resource_size_t size, resource_size_t align) resource_size_t size, resource_size_t align)
{ {
struct pcmcia_align_data *data = align_data; struct pcmcia_align_data *data = align_data;
......
...@@ -534,7 +534,7 @@ struct pcmcia_align_data { ...@@ -534,7 +534,7 @@ struct pcmcia_align_data {
}; };
static resource_size_t static resource_size_t
pcmcia_common_align(void *align_data, struct resource *res, pcmcia_common_align(void *align_data, const struct resource *res,
resource_size_t size, resource_size_t align) resource_size_t size, resource_size_t align)
{ {
struct pcmcia_align_data *data = align_data; struct pcmcia_align_data *data = align_data;
...@@ -549,8 +549,8 @@ pcmcia_common_align(void *align_data, struct resource *res, ...@@ -549,8 +549,8 @@ pcmcia_common_align(void *align_data, struct resource *res,
} }
static resource_size_t static resource_size_t
pcmcia_align(void *align_data, struct resource *res, resource_size_t size, pcmcia_align(void *align_data, const struct resource *res,
resource_size_t align) resource_size_t size, resource_size_t align)
{ {
struct pcmcia_align_data *data = align_data; struct pcmcia_align_data *data = align_data;
struct resource_map *m; struct resource_map *m;
......
...@@ -121,7 +121,7 @@ extern int allocate_resource(struct resource *root, struct resource *new, ...@@ -121,7 +121,7 @@ extern int allocate_resource(struct resource *root, struct resource *new,
resource_size_t size, resource_size_t min, resource_size_t size, resource_size_t min,
resource_size_t max, resource_size_t align, resource_size_t max, resource_size_t align,
resource_size_t (*alignf)(void *, resource_size_t (*alignf)(void *,
struct resource *, const struct resource *,
resource_size_t, resource_size_t,
resource_size_t), resource_size_t),
void *alignf_data); void *alignf_data);
......
...@@ -592,7 +592,7 @@ int __must_check pcibios_enable_device(struct pci_dev *, int mask); ...@@ -592,7 +592,7 @@ int __must_check pcibios_enable_device(struct pci_dev *, int mask);
char *pcibios_setup(char *str); char *pcibios_setup(char *str);
/* Used only when drivers/pci/setup.c is used */ /* Used only when drivers/pci/setup.c is used */
resource_size_t pcibios_align_resource(void *, struct resource *, resource_size_t pcibios_align_resource(void *, const struct resource *,
resource_size_t, resource_size_t,
resource_size_t); resource_size_t);
void pcibios_update_irq(struct pci_dev *, int irq); 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,7 +828,8 @@ int __must_check pci_bus_alloc_resource(struct pci_bus *bus,
struct resource *res, resource_size_t size, struct resource *res, resource_size_t size,
resource_size_t align, resource_size_t min, resource_size_t align, resource_size_t min,
unsigned int type_mask, unsigned int type_mask,
resource_size_t (*alignf)(void *, struct resource *, resource_size_t (*alignf)(void *,
const struct resource *,
resource_size_t, resource_size_t,
resource_size_t), resource_size_t),
void *alignf_data); void *alignf_data);
......
...@@ -304,7 +304,7 @@ static int find_resource(struct resource *root, struct resource *new, ...@@ -304,7 +304,7 @@ static int find_resource(struct resource *root, struct resource *new,
resource_size_t size, resource_size_t min, resource_size_t size, resource_size_t min,
resource_size_t max, resource_size_t align, resource_size_t max, resource_size_t align,
resource_size_t (*alignf)(void *, resource_size_t (*alignf)(void *,
struct resource *, const struct resource *,
resource_size_t, resource_size_t,
resource_size_t), resource_size_t),
void *alignf_data) void *alignf_data)
...@@ -361,7 +361,7 @@ int allocate_resource(struct resource *root, struct resource *new, ...@@ -361,7 +361,7 @@ int allocate_resource(struct resource *root, struct resource *new,
resource_size_t size, resource_size_t min, resource_size_t size, resource_size_t min,
resource_size_t max, resource_size_t align, resource_size_t max, resource_size_t align,
resource_size_t (*alignf)(void *, resource_size_t (*alignf)(void *,
struct resource *, const struct resource *,
resource_size_t, resource_size_t,
resource_size_t), resource_size_t),
void *alignf_data) void *alignf_data)
......
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