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/sbshc.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/sbshc.c')
-rw-r--r-- | drivers/acpi/sbshc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/acpi/sbshc.c b/drivers/acpi/sbshc.c index a4e3767b8c64..001d9143a2cb 100644 --- a/drivers/acpi/sbshc.c +++ b/drivers/acpi/sbshc.c | |||
@@ -282,7 +282,7 @@ static int acpi_smbus_hc_add(struct acpi_device *device) | |||
282 | hc->ec = acpi_driver_data(device->parent); | 282 | hc->ec = acpi_driver_data(device->parent); |
283 | hc->offset = (val >> 8) & 0xff; | 283 | hc->offset = (val >> 8) & 0xff; |
284 | hc->query_bit = val & 0xff; | 284 | hc->query_bit = val & 0xff; |
285 | acpi_driver_data(device) = hc; | 285 | device->driver_data = hc; |
286 | 286 | ||
287 | acpi_ec_add_query_handler(hc->ec, hc->query_bit, NULL, smbus_alarm, hc); | 287 | acpi_ec_add_query_handler(hc->ec, hc->query_bit, NULL, smbus_alarm, hc); |
288 | printk(KERN_INFO PREFIX "SBS HC: EC = 0x%p, offset = 0x%0x, query_bit = 0x%0x\n", | 288 | printk(KERN_INFO PREFIX "SBS HC: EC = 0x%p, offset = 0x%0x, query_bit = 0x%0x\n", |
@@ -303,7 +303,7 @@ static int acpi_smbus_hc_remove(struct acpi_device *device, int type) | |||
303 | hc = acpi_driver_data(device); | 303 | hc = acpi_driver_data(device); |
304 | acpi_ec_remove_query_handler(hc->ec, hc->query_bit); | 304 | acpi_ec_remove_query_handler(hc->ec, hc->query_bit); |
305 | kfree(hc); | 305 | kfree(hc); |
306 | acpi_driver_data(device) = NULL; | 306 | device->driver_data = NULL; |
307 | return 0; | 307 | return 0; |
308 | } | 308 | } |
309 | 309 | ||