diff options
author | Pavel Machek <pavel@suse.cz> | 2008-09-22 17:37:34 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-10-10 18:05:53 -0400 |
commit | db89b4f0dbab837d0f3de2c3e9427a8d5393afa3 (patch) | |
tree | e664a0af46cb02d91c699015268d4fa10a6ce190 /drivers/acpi/power.c | |
parent | 9e113e0014204bfb44a2baa29b2a141ede41b074 (diff) |
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>
Diffstat (limited to 'drivers/acpi/power.c')
-rw-r--r-- | drivers/acpi/power.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index 4ab21cb1c8c7..1bef9429189b 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c | |||
@@ -657,7 +657,7 @@ static int acpi_power_add(struct acpi_device *device) | |||
657 | strcpy(resource->name, device->pnp.bus_id); | 657 | strcpy(resource->name, device->pnp.bus_id); |
658 | strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME); | 658 | strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME); |
659 | strcpy(acpi_device_class(device), ACPI_POWER_CLASS); | 659 | strcpy(acpi_device_class(device), ACPI_POWER_CLASS); |
660 | acpi_driver_data(device) = resource; | 660 | device->driver_data = resource; |
661 | 661 | ||
662 | /* Evalute the object to get the system level and resource order. */ | 662 | /* Evalute the object to get the system level and resource order. */ |
663 | status = acpi_evaluate_object(device->handle, NULL, NULL, &buffer); | 663 | status = acpi_evaluate_object(device->handle, NULL, NULL, &buffer); |
@@ -733,7 +733,7 @@ static int acpi_power_resume(struct acpi_device *device) | |||
733 | if (!device || !acpi_driver_data(device)) | 733 | if (!device || !acpi_driver_data(device)) |
734 | return -EINVAL; | 734 | return -EINVAL; |
735 | 735 | ||
736 | resource = (struct acpi_power_resource *)acpi_driver_data(device); | 736 | resource = acpi_driver_data(device); |
737 | 737 | ||
738 | result = acpi_power_get_state(resource, &state); | 738 | result = acpi_power_get_state(resource, &state); |
739 | if (result) | 739 | if (result) |