Commit fba2ae30 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

ACPI: utils: Clean up printing messages

Replace all of the ACPI_DEBUG_PRINT() instances in utils.c with
pr_debug() and acpi_handle_debug(), drop the _COMPONENT and
ACPI_MODULE_NAME() definitions that are not used any more and
replace direct printk() invocations with pr_debug() calls (the log
level in there is way excessive).

Also add a special pr_fmt() definition, but this only affects the
pr_debug() messages mentioned above.
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent e52d9d8c
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com> * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
*/ */
#define pr_fmt(fmt) "ACPI: utils: " fmt
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -18,24 +20,12 @@ ...@@ -18,24 +20,12 @@
#include "internal.h" #include "internal.h"
#include "sleep.h" #include "sleep.h"
#define _COMPONENT ACPI_BUS_COMPONENT
ACPI_MODULE_NAME("utils");
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Object Evaluation Helpers Object Evaluation Helpers
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static void static void acpi_util_eval_error(acpi_handle h, acpi_string p, acpi_status s)
acpi_util_eval_error(acpi_handle h, acpi_string p, acpi_status s)
{ {
#ifdef ACPI_DEBUG_OUTPUT acpi_handle_debug(h, "Evaluate [%s]: %s\n", p, acpi_format_exception(s));
char prefix[80] = {'\0'};
struct acpi_buffer buffer = {sizeof(prefix), prefix};
acpi_get_name(h, ACPI_FULL_PATHNAME, &buffer);
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluate [%s.%s]: %s\n",
(char *) prefix, p, acpi_format_exception(s)));
#else
return;
#endif
} }
acpi_status acpi_status
...@@ -53,24 +43,23 @@ acpi_extract_package(union acpi_object *package, ...@@ -53,24 +43,23 @@ acpi_extract_package(union acpi_object *package,
if (!package || (package->type != ACPI_TYPE_PACKAGE) if (!package || (package->type != ACPI_TYPE_PACKAGE)
|| (package->package.count < 1)) { || (package->package.count < 1)) {
printk(KERN_WARNING PREFIX "Invalid package argument\n"); pr_debug("Invalid package argument\n");
return AE_BAD_PARAMETER; return AE_BAD_PARAMETER;
} }
if (!format || !format->pointer || (format->length < 1)) { if (!format || !format->pointer || (format->length < 1)) {
printk(KERN_WARNING PREFIX "Invalid format argument\n"); pr_debug("Invalid format argument\n");
return AE_BAD_PARAMETER; return AE_BAD_PARAMETER;
} }
if (!buffer) { if (!buffer) {
printk(KERN_WARNING PREFIX "Invalid buffer argument\n"); pr_debug("Invalid buffer argument\n");
return AE_BAD_PARAMETER; return AE_BAD_PARAMETER;
} }
format_count = (format->length / sizeof(char)) - 1; format_count = (format->length / sizeof(char)) - 1;
if (format_count > package->package.count) { if (format_count > package->package.count) {
printk(KERN_WARNING PREFIX "Format specifies more objects [%d]" pr_debug("Format specifies more objects [%d] than present [%d]\n",
" than exist in package [%d].\n",
format_count, package->package.count); format_count, package->package.count);
return AE_BAD_DATA; return AE_BAD_DATA;
} }
...@@ -99,9 +88,7 @@ acpi_extract_package(union acpi_object *package, ...@@ -99,9 +88,7 @@ acpi_extract_package(union acpi_object *package,
tail_offset += sizeof(char *); tail_offset += sizeof(char *);
break; break;
default: default:
printk(KERN_WARNING PREFIX "Invalid package element" pr_debug("Invalid package element [%d]: got number, expected [%c]\n",
" [%d]: got number, expecting"
" [%c]\n",
i, format_string[i]); i, format_string[i]);
return AE_BAD_DATA; return AE_BAD_DATA;
} }
...@@ -123,9 +110,7 @@ acpi_extract_package(union acpi_object *package, ...@@ -123,9 +110,7 @@ acpi_extract_package(union acpi_object *package,
tail_offset += sizeof(u8 *); tail_offset += sizeof(u8 *);
break; break;
default: default:
printk(KERN_WARNING PREFIX "Invalid package element" pr_debug("Invalid package element [%d] got string/buffer, expected [%c]\n",
" [%d] got string/buffer,"
" expecting [%c]\n",
i, format_string[i]); i, format_string[i]);
return AE_BAD_DATA; return AE_BAD_DATA;
} }
...@@ -137,9 +122,7 @@ acpi_extract_package(union acpi_object *package, ...@@ -137,9 +122,7 @@ acpi_extract_package(union acpi_object *package,
tail_offset += sizeof(void *); tail_offset += sizeof(void *);
break; break;
default: default:
printk(KERN_WARNING PREFIX "Invalid package element" pr_debug("Invalid package element [%d] got reference, expected [%c]\n",
" [%d] got reference,"
" expecting [%c]\n",
i, format_string[i]); i, format_string[i]);
return AE_BAD_DATA; return AE_BAD_DATA;
} }
...@@ -147,9 +130,7 @@ acpi_extract_package(union acpi_object *package, ...@@ -147,9 +130,7 @@ acpi_extract_package(union acpi_object *package,
case ACPI_TYPE_PACKAGE: case ACPI_TYPE_PACKAGE:
default: default:
ACPI_DEBUG_PRINT((ACPI_DB_INFO, pr_debug("Unsupported element at index=%d\n", i);
"Found unsupported element at index=%d\n",
i));
/* TBD: handle nested packages... */ /* TBD: handle nested packages... */
return AE_SUPPORT; return AE_SUPPORT;
} }
...@@ -289,7 +270,7 @@ acpi_evaluate_integer(acpi_handle handle, ...@@ -289,7 +270,7 @@ acpi_evaluate_integer(acpi_handle handle,
*data = element.integer.value; *data = element.integer.value;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%llu]\n", *data)); acpi_handle_debug(handle, "Return value [%llu]\n", *data);
return AE_OK; return AE_OK;
} }
...@@ -363,8 +344,7 @@ acpi_evaluate_reference(acpi_handle handle, ...@@ -363,8 +344,7 @@ acpi_evaluate_reference(acpi_handle handle,
/* Get the acpi_handle. */ /* Get the acpi_handle. */
list->handles[i] = element->reference.handle; list->handles[i] = element->reference.handle;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found reference [%p]\n", acpi_handle_debug(list->handles[i], "Found in reference list\n");
list->handles[i]));
} }
end: end:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment