From db89b4f0dbab837d0f3de2c3e9427a8d5393afa3 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Mon, 22 Sep 2008 14:37:34 -0700 Subject: 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 Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- drivers/acpi/button.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/acpi/button.c') diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index 1dfec413588..e22033ea261 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c @@ -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) { -- cgit v1.2.3 From 27663c5855b10af9ec67bc7dfba001426ba21222 Mon Sep 17 00:00:00 2001 From: Matthew Wilcox Date: Fri, 10 Oct 2008 02:22:59 -0400 Subject: ACPI: Change acpi_evaluate_integer to support 64-bit on 32-bit kernels As of version 2.0, ACPI can return 64-bit integers. The current acpi_evaluate_integer only supports 64-bit integers on 64-bit platforms. Change the argument to take a pointer to an acpi_integer so we support 64-bit integers on all platforms. lenb: replaced use of "acpi_integer" with "unsigned long long" lenb: fixed bug in acpi_thermal_trips_update() Signed-off-by: Matthew Wilcox Signed-off-by: Len Brown --- drivers/acpi/button.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/acpi/button.c') diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index 1dfec413588..baeb661ca95 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c @@ -145,7 +145,7 @@ static int acpi_button_state_seq_show(struct seq_file *seq, void *offset) { struct acpi_button *button = seq->private; acpi_status status; - unsigned long state; + unsigned long long state; if (!button || !button->device) return 0; @@ -253,7 +253,7 @@ static int acpi_button_remove_fs(struct acpi_device *device) -------------------------------------------------------------------------- */ static int acpi_lid_send_state(struct acpi_button *button) { - unsigned long state; + unsigned long long state; acpi_status status; status = acpi_evaluate_integer(button->device->handle, "_LID", NULL, -- cgit v1.2.3