diff options
author | Jeff Garzik <jeff@garzik.org> | 2007-10-03 15:15:40 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-10-09 20:22:20 -0400 |
commit | 1855256c497ecfefc730df6032243f26855ce52c (patch) | |
tree | b73947f1a5e1b798e1dec068ac1cda25ae910bf6 /arch/i386/kernel/apm.c | |
parent | bbf25010f1a6b761914430f5fca081ec8c7accd1 (diff) |
drivers/firmware: const-ify DMI API and internals
Three main sets of changes:
1) dmi_get_system_info() return value should have been marked const,
since callers should not be changing that data.
2) const-ify DMI internals, since DMI firmware tables should,
whenever possible, be marked const to ensure we never ever write to
that data area.
3) const-ify DMI API, to enable marking tables const where possible
in low-level drivers.
And if we're really lucky, this might enable some additional
optimizations on the part of the compiler.
The bulk of the changes are #2 and #3, which are interrelated. #1 could
have been a separate patch, but it was so small compared to the others,
it was easier to roll it into this changeset.
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'arch/i386/kernel/apm.c')
-rw-r--r-- | arch/i386/kernel/apm.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c index f02a8aca826b..32f2365c26ed 100644 --- a/arch/i386/kernel/apm.c +++ b/arch/i386/kernel/apm.c | |||
@@ -1869,7 +1869,7 @@ static struct miscdevice apm_device = { | |||
1869 | 1869 | ||
1870 | 1870 | ||
1871 | /* Simple "print if true" callback */ | 1871 | /* Simple "print if true" callback */ |
1872 | static int __init print_if_true(struct dmi_system_id *d) | 1872 | static int __init print_if_true(const struct dmi_system_id *d) |
1873 | { | 1873 | { |
1874 | printk("%s\n", d->ident); | 1874 | printk("%s\n", d->ident); |
1875 | return 0; | 1875 | return 0; |
@@ -1879,14 +1879,14 @@ static int __init print_if_true(struct dmi_system_id *d) | |||
1879 | * Some Bioses enable the PS/2 mouse (touchpad) at resume, even if it was | 1879 | * Some Bioses enable the PS/2 mouse (touchpad) at resume, even if it was |
1880 | * disabled before the suspend. Linux used to get terribly confused by that. | 1880 | * disabled before the suspend. Linux used to get terribly confused by that. |
1881 | */ | 1881 | */ |
1882 | static int __init broken_ps2_resume(struct dmi_system_id *d) | 1882 | static int __init broken_ps2_resume(const struct dmi_system_id *d) |
1883 | { | 1883 | { |
1884 | printk(KERN_INFO "%s machine detected. Mousepad Resume Bug workaround hopefully not needed.\n", d->ident); | 1884 | printk(KERN_INFO "%s machine detected. Mousepad Resume Bug workaround hopefully not needed.\n", d->ident); |
1885 | return 0; | 1885 | return 0; |
1886 | } | 1886 | } |
1887 | 1887 | ||
1888 | /* Some bioses have a broken protected mode poweroff and need to use realmode */ | 1888 | /* Some bioses have a broken protected mode poweroff and need to use realmode */ |
1889 | static int __init set_realmode_power_off(struct dmi_system_id *d) | 1889 | static int __init set_realmode_power_off(const struct dmi_system_id *d) |
1890 | { | 1890 | { |
1891 | if (apm_info.realmode_power_off == 0) { | 1891 | if (apm_info.realmode_power_off == 0) { |
1892 | apm_info.realmode_power_off = 1; | 1892 | apm_info.realmode_power_off = 1; |
@@ -1896,7 +1896,7 @@ static int __init set_realmode_power_off(struct dmi_system_id *d) | |||
1896 | } | 1896 | } |
1897 | 1897 | ||
1898 | /* Some laptops require interrupts to be enabled during APM calls */ | 1898 | /* Some laptops require interrupts to be enabled during APM calls */ |
1899 | static int __init set_apm_ints(struct dmi_system_id *d) | 1899 | static int __init set_apm_ints(const struct dmi_system_id *d) |
1900 | { | 1900 | { |
1901 | if (apm_info.allow_ints == 0) { | 1901 | if (apm_info.allow_ints == 0) { |
1902 | apm_info.allow_ints = 1; | 1902 | apm_info.allow_ints = 1; |
@@ -1906,7 +1906,7 @@ static int __init set_apm_ints(struct dmi_system_id *d) | |||
1906 | } | 1906 | } |
1907 | 1907 | ||
1908 | /* Some APM bioses corrupt memory or just plain do not work */ | 1908 | /* Some APM bioses corrupt memory or just plain do not work */ |
1909 | static int __init apm_is_horked(struct dmi_system_id *d) | 1909 | static int __init apm_is_horked(const struct dmi_system_id *d) |
1910 | { | 1910 | { |
1911 | if (apm_info.disabled == 0) { | 1911 | if (apm_info.disabled == 0) { |
1912 | apm_info.disabled = 1; | 1912 | apm_info.disabled = 1; |
@@ -1915,7 +1915,7 @@ static int __init apm_is_horked(struct dmi_system_id *d) | |||
1915 | return 0; | 1915 | return 0; |
1916 | } | 1916 | } |
1917 | 1917 | ||
1918 | static int __init apm_is_horked_d850md(struct dmi_system_id *d) | 1918 | static int __init apm_is_horked_d850md(const struct dmi_system_id *d) |
1919 | { | 1919 | { |
1920 | if (apm_info.disabled == 0) { | 1920 | if (apm_info.disabled == 0) { |
1921 | apm_info.disabled = 1; | 1921 | apm_info.disabled = 1; |
@@ -1927,7 +1927,7 @@ static int __init apm_is_horked_d850md(struct dmi_system_id *d) | |||
1927 | } | 1927 | } |
1928 | 1928 | ||
1929 | /* Some APM bioses hang on APM idle calls */ | 1929 | /* Some APM bioses hang on APM idle calls */ |
1930 | static int __init apm_likes_to_melt(struct dmi_system_id *d) | 1930 | static int __init apm_likes_to_melt(const struct dmi_system_id *d) |
1931 | { | 1931 | { |
1932 | if (apm_info.forbid_idle == 0) { | 1932 | if (apm_info.forbid_idle == 0) { |
1933 | apm_info.forbid_idle = 1; | 1933 | apm_info.forbid_idle = 1; |
@@ -1951,7 +1951,7 @@ static int __init apm_likes_to_melt(struct dmi_system_id *d) | |||
1951 | * Phoenix A04 08/24/2000 is known bad (Dell Inspiron 5000e) | 1951 | * Phoenix A04 08/24/2000 is known bad (Dell Inspiron 5000e) |
1952 | * Phoenix A07 09/29/2000 is known good (Dell Inspiron 5000) | 1952 | * Phoenix A07 09/29/2000 is known good (Dell Inspiron 5000) |
1953 | */ | 1953 | */ |
1954 | static int __init broken_apm_power(struct dmi_system_id *d) | 1954 | static int __init broken_apm_power(const struct dmi_system_id *d) |
1955 | { | 1955 | { |
1956 | apm_info.get_power_status_broken = 1; | 1956 | apm_info.get_power_status_broken = 1; |
1957 | printk(KERN_WARNING "BIOS strings suggest APM bugs, disabling power status reporting.\n"); | 1957 | printk(KERN_WARNING "BIOS strings suggest APM bugs, disabling power status reporting.\n"); |
@@ -1962,7 +1962,7 @@ static int __init broken_apm_power(struct dmi_system_id *d) | |||
1962 | * This bios swaps the APM minute reporting bytes over (Many sony laptops | 1962 | * This bios swaps the APM minute reporting bytes over (Many sony laptops |
1963 | * have this problem). | 1963 | * have this problem). |
1964 | */ | 1964 | */ |
1965 | static int __init swab_apm_power_in_minutes(struct dmi_system_id *d) | 1965 | static int __init swab_apm_power_in_minutes(const struct dmi_system_id *d) |
1966 | { | 1966 | { |
1967 | apm_info.get_power_status_swabinminutes = 1; | 1967 | apm_info.get_power_status_swabinminutes = 1; |
1968 | printk(KERN_WARNING "BIOS strings suggest APM reports battery life in minutes and wrong byte order.\n"); | 1968 | printk(KERN_WARNING "BIOS strings suggest APM reports battery life in minutes and wrong byte order.\n"); |