Skip to content

Commit

Permalink
thinkpad-acpi: acpi_evalf fixes
Browse files Browse the repository at this point in the history
Use acpi_format_exception() in acpi_evalf() instead of logging numeric
errors.

Also, when ACPICA returns an error, we should not be touching the return
object, as it is invalid.  In debug mode, acpi_evalf() callers would
printk the returned crap (but fortunately, not use it).

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
  • Loading branch information
Henrique de Moraes Holschuh committed May 16, 2010
1 parent 437e470 commit 263f4a3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/platform/x86/thinkpad_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,9 +605,10 @@ static int acpi_evalf(acpi_handle handle,

switch (res_type) {
case 'd': /* int */
if (res)
success = (status == AE_OK &&
out_obj.type == ACPI_TYPE_INTEGER);
if (success && res)
*(int *)res = out_obj.integer.value;
success = status == AE_OK && out_obj.type == ACPI_TYPE_INTEGER;
break;
case 'v': /* void */
success = status == AE_OK;
Expand All @@ -620,8 +621,8 @@ static int acpi_evalf(acpi_handle handle,
}

if (!success && !quiet)
printk(TPACPI_ERR "acpi_evalf(%s, %s, ...) failed: %d\n",
method, fmt0, status);
printk(TPACPI_ERR "acpi_evalf(%s, %s, ...) failed: %s\n",
method, fmt0, acpi_format_exception(status));

return success;
}
Expand Down

0 comments on commit 263f4a3

Please sign in to comment.