Skip to contentSkip to conversation

fujitsu-laptop: Fix tests of acpi_evaluate_integer() return

PATCH In review Roel Kluin 2 participants 2 messages Oct 12, 2009

Subsystems (3)
lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 fujitsu-laptop: Fix tests of acpi_evaluate_integer() return

The wrong test was used acpi_status status is unsigned.

---

drivers/platform/x86/fujitsu-laptop.c +2 -2
index f35aee5..e3c21ee 100644
@@ -376,7 +376,7 @@ static int get_lcd_level(void)
 
 	status =
 	    acpi_evaluate_integer(fujitsu->acpi_handle, "GBLL", NULL, &state);
-	if (status < 0)
+	if (ACPI_FAILURE(status))
 		return status;
 
 	fujitsu->brightness_level = state & 0x0fffffff;
@@ -398,7 +398,7 @@ static int get_max_brightness(void)
 
 	status =
 	    acpi_evaluate_integer(fujitsu->acpi_handle, "RBLL", NULL, &state);
-	if (status < 0)
+	if (ACPI_FAILURE(status))
 		return status;
 
 	fujitsu->max_brightness = state;
Acked-by on v1 1/1
#1 lore raw
Quoted 18 lines

The wrong test was used acpi_status status is unsigned.

---

drivers/platform/x86/fujitsu-laptop.c +1 -1
index f35aee5..e3c21ee 100644
@@ -376,7 +376,7 @@ static int get_lcd_level(void)
 
 	status =
 	    acpi_evaluate_integer(fujitsu->acpi_handle, "GBLL", NULL, &state);
-	if (status < 0)
+	if (ACPI_FAILURE(status))
 		return status;
 
 	fujitsu->brightness_level = state & 0x0fffffff;

drivers/platform/x86/fujitsu-laptop.c static int get_max_brightness(void) · line 404

Quoted 8 lines
drivers/platform/x86/fujitsu-laptop.c +1 -1
@@ -398,7 +398,7 @@ static int get_max_brightness(void)
 
 	status =
 	    acpi_evaluate_integer(fujitsu->acpi_handle, "RBLL", NULL, &state);
-	if (status < 0)
+	if (ACPI_FAILURE(status))
 		return status;
 
 	fujitsu->max_brightness = state;

Thanks Roel. Looks perfectly reasonable to me.