diff options
author | Jan Beulich <JBeulich@suse.com> | 2011-09-15 03:58:51 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2011-10-14 12:05:28 -0400 |
commit | 72da0b07b1b497927758a2102b856ce41e4ba81e (patch) | |
tree | ad8e8f895c60fb2dfe0d5922e7c9ca9e8b75e6fe /arch/x86/pci/direct.c | |
parent | a94d072b20239f6f615dc20f0a54f63e9b642f9e (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/direct.c')
-rw-r--r-- | arch/x86/pci/direct.c | 6 |
1 files changed, 3 insertions, 3 deletions
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 | ||
82 | struct pci_raw_ops pci_direct_conf1 = { | 82 | const 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 | ||
178 | struct pci_raw_ops pci_direct_conf2 = { | 178 | static 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 | */ |
194 | static int __init pci_sanity_check(struct pci_raw_ops *o) | 194 | static 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; |