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 /drivers/acpi | |
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>
Diffstat (limited to 'drivers/acpi')
-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 |
8 files changed, 10 insertions, 10 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, |