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: Pavel Machek <pavel@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
@@ -657,7 +657,7 @@ static int acpi_power_add(struct acpi_device *device)
|
||||
strcpy(resource->name, device->pnp.bus_id);
|
||||
strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME);
|
||||
strcpy(acpi_device_class(device), ACPI_POWER_CLASS);
|
||||
acpi_driver_data(device) = resource;
|
||||
device->driver_data = resource;
|
||||
|
||||
/* Evalute the object to get the system level and resource order. */
|
||||
status = acpi_evaluate_object(device->handle, NULL, NULL, &buffer);
|
||||
@@ -733,7 +733,7 @@ static int acpi_power_resume(struct acpi_device *device)
|
||||
if (!device || !acpi_driver_data(device))
|
||||
return -EINVAL;
|
||||
|
||||
resource = (struct acpi_power_resource *)acpi_driver_data(device);
|
||||
resource = acpi_driver_data(device);
|
||||
|
||||
result = acpi_power_get_state(resource, &state);
|
||||
if (result)
|
||||
|
Reference in New Issue
Block a user