提交 4ac9cbfa 编写于 作者: M Mathias Krause 提交者: Bjorn Helgaas

x86/PCI: Mark DMI tables as initialization data

The DMI tables are only used in __init code, thereby can be marked as
initialization data, too.  The same is true for the callback functions
referenced from the DMI tables.

This moves ~9.6 kB of code and r/o data to the init sections, marking the
memory for release after initialization.
Signed-off-by: NMathias Krause <minipli@googlemail.com>
Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
Acked-by: NIngo Molnar <mingo@kernel.org>
上级 52addcf9
...@@ -81,14 +81,14 @@ struct pci_ops pci_root_ops = { ...@@ -81,14 +81,14 @@ struct pci_ops pci_root_ops = {
*/ */
DEFINE_RAW_SPINLOCK(pci_config_lock); DEFINE_RAW_SPINLOCK(pci_config_lock);
static int can_skip_ioresource_align(const struct dmi_system_id *d) static int __init can_skip_ioresource_align(const struct dmi_system_id *d)
{ {
pci_probe |= PCI_CAN_SKIP_ISA_ALIGN; pci_probe |= PCI_CAN_SKIP_ISA_ALIGN;
printk(KERN_INFO "PCI: %s detected, can skip ISA alignment\n", d->ident); printk(KERN_INFO "PCI: %s detected, can skip ISA alignment\n", d->ident);
return 0; return 0;
} }
static const struct dmi_system_id can_skip_pciprobe_dmi_table[] = { static const struct dmi_system_id can_skip_pciprobe_dmi_table[] __initconst = {
/* /*
* Systems where PCI IO resource ISA alignment can be skipped * Systems where PCI IO resource ISA alignment can be skipped
* when the ISA enable bit in the bridge control is not set * when the ISA enable bit in the bridge control is not set
...@@ -186,7 +186,7 @@ void pcibios_remove_bus(struct pci_bus *bus) ...@@ -186,7 +186,7 @@ void pcibios_remove_bus(struct pci_bus *bus)
* on the kernel command line (which was parsed earlier). * on the kernel command line (which was parsed earlier).
*/ */
static int set_bf_sort(const struct dmi_system_id *d) static int __init set_bf_sort(const struct dmi_system_id *d)
{ {
if (pci_bf_sort == pci_bf_sort_default) { if (pci_bf_sort == pci_bf_sort_default) {
pci_bf_sort = pci_dmi_bf; pci_bf_sort = pci_dmi_bf;
...@@ -195,7 +195,7 @@ static int set_bf_sort(const struct dmi_system_id *d) ...@@ -195,7 +195,7 @@ static int set_bf_sort(const struct dmi_system_id *d)
return 0; return 0;
} }
static void read_dmi_type_b1(const struct dmi_header *dm, static void __init read_dmi_type_b1(const struct dmi_header *dm,
void *private_data) void *private_data)
{ {
u8 *d = (u8 *)dm + 4; u8 *d = (u8 *)dm + 4;
...@@ -217,7 +217,7 @@ static void read_dmi_type_b1(const struct dmi_header *dm, ...@@ -217,7 +217,7 @@ static void read_dmi_type_b1(const struct dmi_header *dm,
} }
} }
static int find_sort_method(const struct dmi_system_id *d) static int __init find_sort_method(const struct dmi_system_id *d)
{ {
dmi_walk(read_dmi_type_b1, NULL); dmi_walk(read_dmi_type_b1, NULL);
...@@ -232,7 +232,7 @@ static int find_sort_method(const struct dmi_system_id *d) ...@@ -232,7 +232,7 @@ static int find_sort_method(const struct dmi_system_id *d)
* Enable renumbering of PCI bus# ranges to reach all PCI busses (Cardbus) * Enable renumbering of PCI bus# ranges to reach all PCI busses (Cardbus)
*/ */
#ifdef __i386__ #ifdef __i386__
static int assign_all_busses(const struct dmi_system_id *d) static int __init assign_all_busses(const struct dmi_system_id *d)
{ {
pci_probe |= PCI_ASSIGN_ALL_BUSSES; pci_probe |= PCI_ASSIGN_ALL_BUSSES;
printk(KERN_INFO "%s detected: enabling PCI bus# renumbering" printk(KERN_INFO "%s detected: enabling PCI bus# renumbering"
...@@ -241,7 +241,7 @@ static int assign_all_busses(const struct dmi_system_id *d) ...@@ -241,7 +241,7 @@ static int assign_all_busses(const struct dmi_system_id *d)
} }
#endif #endif
static int set_scan_all(const struct dmi_system_id *d) static int __init set_scan_all(const struct dmi_system_id *d)
{ {
printk(KERN_INFO "PCI: %s detected, enabling pci=pcie_scan_all\n", printk(KERN_INFO "PCI: %s detected, enabling pci=pcie_scan_all\n",
d->ident); d->ident);
...@@ -249,7 +249,7 @@ static int set_scan_all(const struct dmi_system_id *d) ...@@ -249,7 +249,7 @@ static int set_scan_all(const struct dmi_system_id *d)
return 0; return 0;
} }
static const struct dmi_system_id pciprobe_dmi_table[] = { static const struct dmi_system_id pciprobe_dmi_table[] __initconst = {
#ifdef __i386__ #ifdef __i386__
/* /*
* Laptops which need pci=assign-busses to see Cardbus cards * Laptops which need pci=assign-busses to see Cardbus cards
...@@ -512,7 +512,7 @@ int __init pcibios_init(void) ...@@ -512,7 +512,7 @@ int __init pcibios_init(void)
return 0; return 0;
} }
char * __init pcibios_setup(char *str) char *__init pcibios_setup(char *str)
{ {
if (!strcmp(str, "off")) { if (!strcmp(str, "off")) {
pci_probe = 0; pci_probe = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册