diff options
author | Vasiliy Kulikov <segoon@openwall.com> | 2011-06-25 13:07:52 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-07-16 18:36:17 -0400 |
commit | 9c8b04be443b33939f374a811c82abeebe0a61d1 (patch) | |
tree | 9d6e3e682e9f1bbcdae726830f54430e860c7fa6 | |
parent | e545b55a1e980cbb6a158886286106bbf39722b1 (diff) |
ACPI: constify ops structs
Structs battery_file, acpi_dock_ops, file_operations,
thermal_cooling_device_ops, thermal_zone_device_ops, kernel_param_ops
are not changed in runtime. It is safe to make them const.
register_hotplug_dock_device() was altered to take const "ops" argument
to respect acpi_dock_ops' const notion.
Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r-- | drivers/acpi/battery.c | 2 | ||||
-rw-r--r-- | drivers/acpi/dock.c | 4 | ||||
-rw-r--r-- | drivers/acpi/ec_sys.c | 2 | ||||
-rw-r--r-- | drivers/acpi/fan.c | 2 | ||||
-rw-r--r-- | drivers/acpi/processor_thermal.c | 2 | ||||
-rw-r--r-- | drivers/acpi/sysfs.c | 4 | ||||
-rw-r--r-- | drivers/acpi/thermal.c | 2 | ||||
-rw-r--r-- | drivers/acpi/video.c | 2 | ||||
-rw-r--r-- | drivers/ata/libata-acpi.c | 4 | ||||
-rw-r--r-- | drivers/pci/hotplug/acpiphp_glue.c | 2 | ||||
-rw-r--r-- | include/acpi/acpi_drivers.h | 2 | ||||
-rw-r--r-- | include/acpi/processor.h | 2 |
12 files changed, 15 insertions, 15 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index fcc13ac0aa18..746b47507e9f 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
@@ -863,7 +863,7 @@ DECLARE_FILE_FUNCTIONS(alarm); | |||
863 | }, \ | 863 | }, \ |
864 | } | 864 | } |
865 | 865 | ||
866 | static struct battery_file { | 866 | static const struct battery_file { |
867 | struct file_operations ops; | 867 | struct file_operations ops; |
868 | mode_t mode; | 868 | mode_t mode; |
869 | const char *name; | 869 | const char *name; |
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index 1864ad3cf895..19a61136d848 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c | |||
@@ -77,7 +77,7 @@ struct dock_dependent_device { | |||
77 | struct list_head list; | 77 | struct list_head list; |
78 | struct list_head hotplug_list; | 78 | struct list_head hotplug_list; |
79 | acpi_handle handle; | 79 | acpi_handle handle; |
80 | struct acpi_dock_ops *ops; | 80 | const struct acpi_dock_ops *ops; |
81 | void *context; | 81 | void *context; |
82 | }; | 82 | }; |
83 | 83 | ||
@@ -589,7 +589,7 @@ EXPORT_SYMBOL_GPL(unregister_dock_notifier); | |||
589 | * the dock driver after _DCK is executed. | 589 | * the dock driver after _DCK is executed. |
590 | */ | 590 | */ |
591 | int | 591 | int |
592 | register_hotplug_dock_device(acpi_handle handle, struct acpi_dock_ops *ops, | 592 | register_hotplug_dock_device(acpi_handle handle, const struct acpi_dock_ops *ops, |
593 | void *context) | 593 | void *context) |
594 | { | 594 | { |
595 | struct dock_dependent_device *dd; | 595 | struct dock_dependent_device *dd; |
diff --git a/drivers/acpi/ec_sys.c b/drivers/acpi/ec_sys.c index 05b44201a614..22f918bacd35 100644 --- a/drivers/acpi/ec_sys.c +++ b/drivers/acpi/ec_sys.c | |||
@@ -92,7 +92,7 @@ static ssize_t acpi_ec_write_io(struct file *f, const char __user *buf, | |||
92 | return count; | 92 | return count; |
93 | } | 93 | } |
94 | 94 | ||
95 | static struct file_operations acpi_ec_io_ops = { | 95 | static const struct file_operations acpi_ec_io_ops = { |
96 | .owner = THIS_MODULE, | 96 | .owner = THIS_MODULE, |
97 | .open = acpi_ec_open_io, | 97 | .open = acpi_ec_open_io, |
98 | .read = acpi_ec_read_io, | 98 | .read = acpi_ec_read_io, |
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c index 467479f07c1f..0f0356ca1a9e 100644 --- a/drivers/acpi/fan.c +++ b/drivers/acpi/fan.c | |||
@@ -110,7 +110,7 @@ fan_set_cur_state(struct thermal_cooling_device *cdev, unsigned long state) | |||
110 | return result; | 110 | return result; |
111 | } | 111 | } |
112 | 112 | ||
113 | static struct thermal_cooling_device_ops fan_cooling_ops = { | 113 | static const struct thermal_cooling_device_ops fan_cooling_ops = { |
114 | .get_max_state = fan_get_max_state, | 114 | .get_max_state = fan_get_max_state, |
115 | .get_cur_state = fan_get_cur_state, | 115 | .get_cur_state = fan_get_cur_state, |
116 | .set_cur_state = fan_set_cur_state, | 116 | .set_cur_state = fan_set_cur_state, |
diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c index 79cb65332894..870550d6a4bf 100644 --- a/drivers/acpi/processor_thermal.c +++ b/drivers/acpi/processor_thermal.c | |||
@@ -244,7 +244,7 @@ processor_set_cur_state(struct thermal_cooling_device *cdev, | |||
244 | return result; | 244 | return result; |
245 | } | 245 | } |
246 | 246 | ||
247 | struct thermal_cooling_device_ops processor_cooling_ops = { | 247 | const struct thermal_cooling_device_ops processor_cooling_ops = { |
248 | .get_max_state = processor_get_max_state, | 248 | .get_max_state = processor_get_max_state, |
249 | .get_cur_state = processor_get_cur_state, | 249 | .get_cur_state = processor_get_cur_state, |
250 | .set_cur_state = processor_set_cur_state, | 250 | .set_cur_state = processor_set_cur_state, |
diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index 77255f250dbb..c538d0ef10ff 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c | |||
@@ -149,12 +149,12 @@ static int param_get_debug_level(char *buffer, const struct kernel_param *kp) | |||
149 | return result; | 149 | return result; |
150 | } | 150 | } |
151 | 151 | ||
152 | static struct kernel_param_ops param_ops_debug_layer = { | 152 | static const struct kernel_param_ops param_ops_debug_layer = { |
153 | .set = param_set_uint, | 153 | .set = param_set_uint, |
154 | .get = param_get_debug_layer, | 154 | .get = param_get_debug_layer, |
155 | }; | 155 | }; |
156 | 156 | ||
157 | static struct kernel_param_ops param_ops_debug_level = { | 157 | static const struct kernel_param_ops param_ops_debug_level = { |
158 | .set = param_set_uint, | 158 | .set = param_set_uint, |
159 | .get = param_get_debug_level, | 159 | .get = param_get_debug_level, |
160 | }; | 160 | }; |
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 2607e17b520f..48fbc647b178 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c | |||
@@ -812,7 +812,7 @@ acpi_thermal_unbind_cooling_device(struct thermal_zone_device *thermal, | |||
812 | thermal_zone_unbind_cooling_device); | 812 | thermal_zone_unbind_cooling_device); |
813 | } | 813 | } |
814 | 814 | ||
815 | static struct thermal_zone_device_ops acpi_thermal_zone_ops = { | 815 | static const struct thermal_zone_device_ops acpi_thermal_zone_ops = { |
816 | .bind = acpi_thermal_bind_cooling_device, | 816 | .bind = acpi_thermal_bind_cooling_device, |
817 | .unbind = acpi_thermal_unbind_cooling_device, | 817 | .unbind = acpi_thermal_unbind_cooling_device, |
818 | .get_temp = thermal_get_temp, | 818 | .get_temp = thermal_get_temp, |
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index db39e9e607d8..c6f9ef8d9ccb 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -308,7 +308,7 @@ video_set_cur_state(struct thermal_cooling_device *cooling_dev, unsigned long st | |||
308 | return acpi_video_device_lcd_set_level(video, level); | 308 | return acpi_video_device_lcd_set_level(video, level); |
309 | } | 309 | } |
310 | 310 | ||
311 | static struct thermal_cooling_device_ops video_cooling_ops = { | 311 | static const struct thermal_cooling_device_ops video_cooling_ops = { |
312 | .get_max_state = video_get_max_state, | 312 | .get_max_state = video_get_max_state, |
313 | .get_cur_state = video_get_cur_state, | 313 | .get_cur_state = video_get_cur_state, |
314 | .set_cur_state = video_set_cur_state, | 314 | .set_cur_state = video_set_cur_state, |
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index a791b8ce6294..993d40620f91 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c | |||
@@ -218,12 +218,12 @@ static void ata_acpi_dev_uevent(acpi_handle handle, u32 event, void *data) | |||
218 | ata_acpi_uevent(dev->link->ap, dev, event); | 218 | ata_acpi_uevent(dev->link->ap, dev, event); |
219 | } | 219 | } |
220 | 220 | ||
221 | static struct acpi_dock_ops ata_acpi_dev_dock_ops = { | 221 | static const struct acpi_dock_ops ata_acpi_dev_dock_ops = { |
222 | .handler = ata_acpi_dev_notify_dock, | 222 | .handler = ata_acpi_dev_notify_dock, |
223 | .uevent = ata_acpi_dev_uevent, | 223 | .uevent = ata_acpi_dev_uevent, |
224 | }; | 224 | }; |
225 | 225 | ||
226 | static struct acpi_dock_ops ata_acpi_ap_dock_ops = { | 226 | static const struct acpi_dock_ops ata_acpi_ap_dock_ops = { |
227 | .handler = ata_acpi_ap_notify_dock, | 227 | .handler = ata_acpi_ap_notify_dock, |
228 | .uevent = ata_acpi_ap_uevent, | 228 | .uevent = ata_acpi_ap_uevent, |
229 | }; | 229 | }; |
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index a70fa89f76fd..220285760b68 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c | |||
@@ -110,7 +110,7 @@ static int post_dock_fixups(struct notifier_block *nb, unsigned long val, | |||
110 | } | 110 | } |
111 | 111 | ||
112 | 112 | ||
113 | static struct acpi_dock_ops acpiphp_dock_ops = { | 113 | static const struct acpi_dock_ops acpiphp_dock_ops = { |
114 | .handler = handle_hotplug_event_func, | 114 | .handler = handle_hotplug_event_func, |
115 | }; | 115 | }; |
116 | 116 | ||
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index 3090471b2a5e..e49c36d38d7e 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h | |||
@@ -128,7 +128,7 @@ extern int is_dock_device(acpi_handle handle); | |||
128 | extern int register_dock_notifier(struct notifier_block *nb); | 128 | extern int register_dock_notifier(struct notifier_block *nb); |
129 | extern void unregister_dock_notifier(struct notifier_block *nb); | 129 | extern void unregister_dock_notifier(struct notifier_block *nb); |
130 | extern int register_hotplug_dock_device(acpi_handle handle, | 130 | extern int register_hotplug_dock_device(acpi_handle handle, |
131 | struct acpi_dock_ops *ops, | 131 | const struct acpi_dock_ops *ops, |
132 | void *context); | 132 | void *context); |
133 | extern void unregister_hotplug_dock_device(acpi_handle handle); | 133 | extern void unregister_hotplug_dock_device(acpi_handle handle); |
134 | #else | 134 | #else |
diff --git a/include/acpi/processor.h b/include/acpi/processor.h index ba4928cae473..67055f180330 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h | |||
@@ -337,7 +337,7 @@ extern struct cpuidle_driver acpi_idle_driver; | |||
337 | 337 | ||
338 | /* in processor_thermal.c */ | 338 | /* in processor_thermal.c */ |
339 | int acpi_processor_get_limit_info(struct acpi_processor *pr); | 339 | int acpi_processor_get_limit_info(struct acpi_processor *pr); |
340 | extern struct thermal_cooling_device_ops processor_cooling_ops; | 340 | extern const struct thermal_cooling_device_ops processor_cooling_ops; |
341 | #ifdef CONFIG_CPU_FREQ | 341 | #ifdef CONFIG_CPU_FREQ |
342 | void acpi_thermal_cpufreq_init(void); | 342 | void acpi_thermal_cpufreq_init(void); |
343 | void acpi_thermal_cpufreq_exit(void); | 343 | void acpi_thermal_cpufreq_exit(void); |