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:
Pavel Machek
2008-09-22 14:37:34 -07:00
committed by Len Brown
parent 9e113e0014
commit db89b4f0db
23 changed files with 34 additions and 30 deletions

View File

@ -300,7 +300,11 @@ struct acpi_device {
enum acpi_bus_removal_type removal_type; /* indicate for different removal type */
};
#define acpi_driver_data(d) ((d)->driver_data)
static inline void *acpi_driver_data(struct acpi_device *d)
{
return d->driver_data;
}
#define to_acpi_device(d) container_of(d, struct acpi_device, dev)
#define to_acpi_driver(d) container_of(d, struct acpi_driver, drv)