Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c8b04be authored by Vasiliy Kulikov's avatar Vasiliy Kulikov Committed by Len Brown
Browse files

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: default avatarVasiliy Kulikov <segoon@openwall.com>
Acked-by: default avatarJeff Garzik <jgarzik@redhat.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent e545b55a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -863,7 +863,7 @@ DECLARE_FILE_FUNCTIONS(alarm);
		}, \
	}

static struct battery_file {
static const struct battery_file {
	struct file_operations ops;
	mode_t mode;
	const char *name;
+2 −2
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ struct dock_dependent_device {
	struct list_head list;
	struct list_head hotplug_list;
	acpi_handle handle;
	struct acpi_dock_ops *ops;
	const struct acpi_dock_ops *ops;
	void *context;
};

@@ -589,7 +589,7 @@ EXPORT_SYMBOL_GPL(unregister_dock_notifier);
 * the dock driver after _DCK is executed.
 */
int
register_hotplug_dock_device(acpi_handle handle, struct acpi_dock_ops *ops,
register_hotplug_dock_device(acpi_handle handle, const struct acpi_dock_ops *ops,
			     void *context)
{
	struct dock_dependent_device *dd;
+1 −1
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ static ssize_t acpi_ec_write_io(struct file *f, const char __user *buf,
	return count;
}

static struct file_operations acpi_ec_io_ops = {
static const struct file_operations acpi_ec_io_ops = {
	.owner = THIS_MODULE,
	.open  = acpi_ec_open_io,
	.read  = acpi_ec_read_io,
+1 −1
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ fan_set_cur_state(struct thermal_cooling_device *cdev, unsigned long state)
	return result;
}

static struct thermal_cooling_device_ops fan_cooling_ops = {
static const struct thermal_cooling_device_ops fan_cooling_ops = {
	.get_max_state = fan_get_max_state,
	.get_cur_state = fan_get_cur_state,
	.set_cur_state = fan_set_cur_state,
+1 −1
Original line number Diff line number Diff line
@@ -244,7 +244,7 @@ processor_set_cur_state(struct thermal_cooling_device *cdev,
	return result;
}

struct thermal_cooling_device_ops processor_cooling_ops = {
const struct thermal_cooling_device_ops processor_cooling_ops = {
	.get_max_state = processor_get_max_state,
	.get_cur_state = processor_get_cur_state,
	.set_cur_state = processor_set_cur_state,
Loading