aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/pci
diff options
context:
space:
mode:
authorJan Beulich <JBeulich@suse.com>2011-09-15 03:58:51 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2011-10-14 12:05:28 -0400
commit72da0b07b1b497927758a2102b856ce41e4ba81e (patch)
treead8e8f895c60fb2dfe0d5922e7c9ca9e8b75e6fe /arch/x86/pci
parenta94d072b20239f6f615dc20f0a54f63e9b642f9e (diff)
x86: constify PCI raw ops structures
As with any other such change, the goal is to prevent inadvertent writes to these structures (assuming DEBUG_RODATA is enabled), and to separate data (possibly frequently) written to from such never getting modified. Reviewed-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'arch/x86/pci')
-rw-r--r--arch/x86/pci/ce4100.c2
-rw-r--r--arch/x86/pci/common.c4
-rw-r--r--arch/x86/pci/direct.c6
-rw-r--r--arch/x86/pci/mmconfig_32.c2
-rw-r--r--arch/x86/pci/mmconfig_64.c2
-rw-r--r--arch/x86/pci/numaq_32.c2
-rw-r--r--arch/x86/pci/olpc.c2
-rw-r--r--arch/x86/pci/pcbios.c4
8 files changed, 12 insertions, 12 deletions
diff --git a/arch/x86/pci/ce4100.c b/arch/x86/pci/ce4100.c
index 99176094500b..41bd2a2d2c50 100644
--- a/arch/x86/pci/ce4100.c
+++ b/arch/x86/pci/ce4100.c
@@ -304,7 +304,7 @@ static int ce4100_conf_write(unsigned int seg, unsigned int bus,
304 return pci_direct_conf1.write(seg, bus, devfn, reg, len, value); 304 return pci_direct_conf1.write(seg, bus, devfn, reg, len, value);
305} 305}
306 306
307struct pci_raw_ops ce4100_pci_conf = { 307static const struct pci_raw_ops ce4100_pci_conf = {
308 .read = ce4100_conf_read, 308 .read = ce4100_conf_read,
309 .write = ce4100_conf_write, 309 .write = ce4100_conf_write,
310}; 310};
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index 92df322e0b57..7962ccb4d9b2 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -33,8 +33,8 @@ int noioapicreroute = 1;
33int pcibios_last_bus = -1; 33int pcibios_last_bus = -1;
34unsigned long pirq_table_addr; 34unsigned long pirq_table_addr;
35struct pci_bus *pci_root_bus; 35struct pci_bus *pci_root_bus;
36struct pci_raw_ops *raw_pci_ops; 36const struct pci_raw_ops *__read_mostly raw_pci_ops;
37struct pci_raw_ops *raw_pci_ext_ops; 37const struct pci_raw_ops *__read_mostly raw_pci_ext_ops;
38 38
39int raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn, 39int raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn,
40 int reg, int len, u32 *val) 40 int reg, int len, u32 *val)
diff --git a/arch/x86/pci/direct.c b/arch/x86/pci/direct.c
index 4f2c70439d7f..15460590b8c5 100644
--- a/arch/x86/pci/direct.c
+++ b/arch/x86/pci/direct.c
@@ -79,7 +79,7 @@ static int pci_conf1_write(unsigned int seg, unsigned int bus,
79 79
80#undef PCI_CONF1_ADDRESS 80#undef PCI_CONF1_ADDRESS
81 81
82struct pci_raw_ops pci_direct_conf1 = { 82const struct pci_raw_ops pci_direct_conf1 = {
83 .read = pci_conf1_read, 83 .read = pci_conf1_read,
84 .write = pci_conf1_write, 84 .write = pci_conf1_write,
85}; 85};
@@ -175,7 +175,7 @@ static int pci_conf2_write(unsigned int seg, unsigned int bus,
175 175
176#undef PCI_CONF2_ADDRESS 176#undef PCI_CONF2_ADDRESS
177 177
178struct pci_raw_ops pci_direct_conf2 = { 178static const struct pci_raw_ops pci_direct_conf2 = {
179 .read = pci_conf2_read, 179 .read = pci_conf2_read,
180 .write = pci_conf2_write, 180 .write = pci_conf2_write,
181}; 181};
@@ -191,7 +191,7 @@ struct pci_raw_ops pci_direct_conf2 = {
191 * This should be close to trivial, but it isn't, because there are buggy 191 * This should be close to trivial, but it isn't, because there are buggy
192 * chipsets (yes, you guessed it, by Intel and Compaq) that have no class ID. 192 * chipsets (yes, you guessed it, by Intel and Compaq) that have no class ID.
193 */ 193 */
194static int __init pci_sanity_check(struct pci_raw_ops *o) 194static int __init pci_sanity_check(const struct pci_raw_ops *o)
195{ 195{
196 u32 x = 0; 196 u32 x = 0;
197 int year, devfn; 197 int year, devfn;
diff --git a/arch/x86/pci/mmconfig_32.c b/arch/x86/pci/mmconfig_32.c
index a3d9c54792ae..5372e86834c0 100644
--- a/arch/x86/pci/mmconfig_32.c
+++ b/arch/x86/pci/mmconfig_32.c
@@ -117,7 +117,7 @@ static int pci_mmcfg_write(unsigned int seg, unsigned int bus,
117 return 0; 117 return 0;
118} 118}
119 119
120static struct pci_raw_ops pci_mmcfg = { 120static const struct pci_raw_ops pci_mmcfg = {
121 .read = pci_mmcfg_read, 121 .read = pci_mmcfg_read,
122 .write = pci_mmcfg_write, 122 .write = pci_mmcfg_write,
123}; 123};
diff --git a/arch/x86/pci/mmconfig_64.c b/arch/x86/pci/mmconfig_64.c
index e783841bd1d7..915a493502cb 100644
--- a/arch/x86/pci/mmconfig_64.c
+++ b/arch/x86/pci/mmconfig_64.c
@@ -81,7 +81,7 @@ static int pci_mmcfg_write(unsigned int seg, unsigned int bus,
81 return 0; 81 return 0;
82} 82}
83 83
84static struct pci_raw_ops pci_mmcfg = { 84static const struct pci_raw_ops pci_mmcfg = {
85 .read = pci_mmcfg_read, 85 .read = pci_mmcfg_read,
86 .write = pci_mmcfg_write, 86 .write = pci_mmcfg_write,
87}; 87};
diff --git a/arch/x86/pci/numaq_32.c b/arch/x86/pci/numaq_32.c
index 512a88c41501..51abf02f9226 100644
--- a/arch/x86/pci/numaq_32.c
+++ b/arch/x86/pci/numaq_32.c
@@ -110,7 +110,7 @@ static int pci_conf1_mq_write(unsigned int seg, unsigned int bus,
110 110
111#undef PCI_CONF1_MQ_ADDRESS 111#undef PCI_CONF1_MQ_ADDRESS
112 112
113static struct pci_raw_ops pci_direct_conf1_mq = { 113static const struct pci_raw_ops pci_direct_conf1_mq = {
114 .read = pci_conf1_mq_read, 114 .read = pci_conf1_mq_read,
115 .write = pci_conf1_mq_write 115 .write = pci_conf1_mq_write
116}; 116};
diff --git a/arch/x86/pci/olpc.c b/arch/x86/pci/olpc.c
index 5262603b04d9..7043a4f0e98a 100644
--- a/arch/x86/pci/olpc.c
+++ b/arch/x86/pci/olpc.c
@@ -301,7 +301,7 @@ static int pci_olpc_write(unsigned int seg, unsigned int bus,
301 return 0; 301 return 0;
302} 302}
303 303
304static struct pci_raw_ops pci_olpc_conf = { 304static const struct pci_raw_ops pci_olpc_conf = {
305 .read = pci_olpc_read, 305 .read = pci_olpc_read,
306 .write = pci_olpc_write, 306 .write = pci_olpc_write,
307}; 307};
diff --git a/arch/x86/pci/pcbios.c b/arch/x86/pci/pcbios.c
index f68553551467..db0e9a51e611 100644
--- a/arch/x86/pci/pcbios.c
+++ b/arch/x86/pci/pcbios.c
@@ -303,7 +303,7 @@ static int pci_bios_write(unsigned int seg, unsigned int bus,
303 * Function table for BIOS32 access 303 * Function table for BIOS32 access
304 */ 304 */
305 305
306static struct pci_raw_ops pci_bios_access = { 306static const struct pci_raw_ops pci_bios_access = {
307 .read = pci_bios_read, 307 .read = pci_bios_read,
308 .write = pci_bios_write 308 .write = pci_bios_write
309}; 309};
@@ -312,7 +312,7 @@ static struct pci_raw_ops pci_bios_access = {
312 * Try to find PCI BIOS. 312 * Try to find PCI BIOS.
313 */ 313 */
314 314
315static struct pci_raw_ops * __devinit pci_find_bios(void) 315static const struct pci_raw_ops * __devinit pci_find_bios(void)
316{ 316{
317 union bios32 *check; 317 union bios32 *check;
318 unsigned char sum; 318 unsigned char sum;