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

Commit db89b4f0 authored by Pavel Machek's avatar Pavel Machek Committed by Len Brown
Browse files

ACPI: catch calls of acpi_driver_data on pointer of wrong type



Catch attempts to use of acpi_driver_data on pointers of wrong type.

akpm: rewritten to use proper C typechecking and remove the
"function"-used-as-lvalue thing.

Signed-off-by: default avatarPavel Machek <pavel@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 9e113e00
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -269,7 +269,7 @@ static int acpi_ac_add(struct acpi_device *device)
	ac->device = device;
	strcpy(acpi_device_name(device), ACPI_AC_DEVICE_NAME);
	strcpy(acpi_device_class(device), ACPI_AC_CLASS);
	acpi_driver_data(device) = ac;
	device->driver_data = ac;

	result = acpi_ac_get_state(ac);
	if (result)
+1 −1
Original line number Diff line number Diff line
@@ -403,7 +403,7 @@ static int acpi_memory_device_add(struct acpi_device *device)
	mem_device->device = device;
	sprintf(acpi_device_name(device), "%s", ACPI_MEMORY_DEVICE_NAME);
	sprintf(acpi_device_class(device), "%s", ACPI_MEMORY_DEVICE_CLASS);
	acpi_driver_data(device) = mem_device;
	device->driver_data = mem_device;

	/* Get the range from the _CRS */
	result = acpi_memory_get_device_resources(mem_device);
+1 −1
Original line number Diff line number Diff line
@@ -1321,7 +1321,7 @@ static int asus_hotk_add(struct acpi_device *device)
	hotk->handle = device->handle;
	strcpy(acpi_device_name(device), ACPI_HOTK_DEVICE_NAME);
	strcpy(acpi_device_class(device), ACPI_HOTK_CLASS);
	acpi_driver_data(device) = hotk;
	device->driver_data = hotk;
	hotk->device = device;

	result = asus_hotk_check();
+1 −1
Original line number Diff line number Diff line
@@ -804,7 +804,7 @@ static int acpi_battery_add(struct acpi_device *device)
	battery->device = device;
	strcpy(acpi_device_name(device), ACPI_BATTERY_DEVICE_NAME);
	strcpy(acpi_device_class(device), ACPI_BATTERY_CLASS);
	acpi_driver_data(device) = battery;
	device->driver_data = battery;
	mutex_init(&battery->lock);
	acpi_battery_update(battery);
#ifdef CONFIG_ACPI_PROCFS_POWER
+1 −1
Original line number Diff line number Diff line
@@ -384,7 +384,7 @@ static int acpi_button_add(struct acpi_device *device)
		return -ENOMEM;

	button->device = device;
	acpi_driver_data(device) = button;
	device->driver_data = button;

	button->input = input = input_allocate_device();
	if (!input) {
Loading