Skip to content

Commit 6faadbb

Browse files
Christoph Hellwigjdelvare
authored andcommitted
dmi: Mark all struct dmi_system_id instances const
... and __initconst if applicable. Based on similar work for an older kernel in the Grsecurity patch. [JD: fix toshiba-wmi build] [JD: add htcpen] [JD: move __initconst where checkscript wants it] Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jean Delvare <jdelvare@suse.de>
1 parent 46c1e79 commit 6faadbb

48 files changed

Lines changed: 52 additions & 52 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/x86/kernel/acpi/boot.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,7 +1373,7 @@ static void __init acpi_reduced_hw_init(void)
13731373
* If your system is blacklisted here, but you find that acpi=force
13741374
* works for you, please contact linux-acpi@vger.kernel.org
13751375
*/
1376-
static struct dmi_system_id __initdata acpi_dmi_table[] = {
1376+
static const struct dmi_system_id acpi_dmi_table[] __initconst = {
13771377
/*
13781378
* Boxes that need ACPI disabled
13791379
*/
@@ -1448,7 +1448,7 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = {
14481448
};
14491449

14501450
/* second table for DMI checks that should run after early-quirks */
1451-
static struct dmi_system_id __initdata acpi_dmi_table_late[] = {
1451+
static const struct dmi_system_id acpi_dmi_table_late[] __initconst = {
14521452
/*
14531453
* HP laptops which use a DSDT reporting as HP/SB400/10000,
14541454
* which includes some code which overrides all temperature

‎arch/x86/kernel/apm_32.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2043,7 +2043,7 @@ static int __init swab_apm_power_in_minutes(const struct dmi_system_id *d)
20432043
return 0;
20442044
}
20452045

2046-
static struct dmi_system_id __initdata apm_dmi_table[] = {
2046+
static const struct dmi_system_id apm_dmi_table[] __initconst = {
20472047
{
20482048
print_if_true,
20492049
KERN_WARNING "IBM T23 - BIOS 1.03b+ and controller firmware 1.02+ may be needed for Linux APM.",

‎arch/x86/kernel/io_delay.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static int __init dmi_io_delay_0xed_port(const struct dmi_system_id *id)
5858
* Quirk table for systems that misbehave (lock up, etc.) if port
5959
* 0x80 is used:
6060
*/
61-
static struct dmi_system_id __initdata io_delay_0xed_port_dmi_table[] = {
61+
static const struct dmi_system_id io_delay_0xed_port_dmi_table[] __initconst = {
6262
{
6363
.callback = dmi_io_delay_0xed_port,
6464
.ident = "Compaq Presario V6000",

‎arch/x86/kernel/reboot.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ static int __init set_kbd_reboot(const struct dmi_system_id *d)
150150
/*
151151
* This is a single dmi_table handling all reboot quirks.
152152
*/
153-
static struct dmi_system_id __initdata reboot_dmi_table[] = {
153+
static const struct dmi_system_id reboot_dmi_table[] __initconst = {
154154

155155
/* Acer */
156156
{ /* Handle reboot issue on Acer Aspire one */

‎arch/x86/pci/irq.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ static int __init fix_acer_tm360_irqrouting(const struct dmi_system_id *d)
10921092
return 0;
10931093
}
10941094

1095-
static struct dmi_system_id __initdata pciirq_dmi_table[] = {
1095+
static const struct dmi_system_id pciirq_dmi_table[] __initconst = {
10961096
{
10971097
.callback = fix_broken_hp_bios_irq9,
10981098
.ident = "HP Pavilion N5400 Series Laptop",

‎arch/x86/power/cpu.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ static int msr_initialize_bdw(const struct dmi_system_id *d)
428428
return msr_init_context(bdw_msr_id, ARRAY_SIZE(bdw_msr_id));
429429
}
430430

431-
static struct dmi_system_id msr_save_dmi_table[] = {
431+
static const struct dmi_system_id msr_save_dmi_table[] = {
432432
{
433433
.callback = msr_initialize_bdw,
434434
.ident = "BROADWELL BDX_EP",

‎drivers/acpi/acpi_video.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ static int video_set_report_key_events(const struct dmi_system_id *id)
418418
return 0;
419419
}
420420

421-
static struct dmi_system_id video_dmi_table[] = {
421+
static const struct dmi_system_id video_dmi_table[] = {
422422
/*
423423
* Broken _BQC workaround http://bugzilla.kernel.org/show_bug.cgi?id=13121
424424
*/

‎drivers/acpi/blacklist.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
#include "internal.h"
3232

33-
static struct dmi_system_id acpi_rev_dmi_table[] __initdata;
33+
static const struct dmi_system_id acpi_rev_dmi_table[] __initconst;
3434

3535
/*
3636
* POLICY: If *anything* doesn't work, put it on the blacklist.
@@ -89,7 +89,7 @@ static int __init dmi_enable_rev_override(const struct dmi_system_id *d)
8989
}
9090
#endif
9191

92-
static struct dmi_system_id acpi_rev_dmi_table[] __initdata = {
92+
static const struct dmi_system_id acpi_rev_dmi_table[] __initconst = {
9393
#ifdef CONFIG_ACPI_REV_OVERRIDE_POSSIBLE
9494
/*
9595
* DELL XPS 13 (2015) switches sound between HDA and I2S

‎drivers/acpi/bus.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static int set_copy_dsdt(const struct dmi_system_id *id)
6767
}
6868
#endif
6969

70-
static struct dmi_system_id dsdt_dmi_table[] __initdata = {
70+
static const struct dmi_system_id dsdt_dmi_table[] __initconst = {
7171
/*
7272
* Invoke DSDT corruption work-around on all Toshiba Satellite.
7373
* https://bugzilla.kernel.org/show_bug.cgi?id=14679
@@ -83,7 +83,7 @@ static struct dmi_system_id dsdt_dmi_table[] __initdata = {
8383
{}
8484
};
8585
#else
86-
static struct dmi_system_id dsdt_dmi_table[] __initdata = {
86+
static const struct dmi_system_id dsdt_dmi_table[] __initconst = {
8787
{}
8888
};
8989
#endif

‎drivers/acpi/ec.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1809,7 +1809,7 @@ static int ec_honor_ecdt_gpe(const struct dmi_system_id *id)
18091809
return 0;
18101810
}
18111811

1812-
static struct dmi_system_id ec_dmi_table[] __initdata = {
1812+
static const struct dmi_system_id ec_dmi_table[] __initconst = {
18131813
{
18141814
ec_correct_ecdt, "MSI MS-171F", {
18151815
DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star"),

0 commit comments

Comments
 (0)