aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2014-07-07 22:07:06 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-07-08 08:22:26 -0400
commit2e70da4c51eb18a4d229aa48763c15f5dbc5b43d (patch)
tree27bbb3864f794852a673f016f4e5be60720f331e /drivers/acpi
parent80a648c12e4bda45c4f1bb93d83184fb3010ac12 (diff)
ACPICA: Utilities: Introduce acpi_log_error() to improve portability
Invocations like fprintf(stderr) and perror() are not portable, this patch introduces acpi_log_error() as a replacement, it is implemented using new portable API - acpi_ut_file_vprintf(). Note that though acpi_os_initialize() need to be invoked prior than using this new API, since no users are introduced in this patch, such invocations are not added for applications that link utprint.c in this patch. Futher patches that introduce users of acpi_log_error() should take care of this. This patch is only useful for ACPICA applications, most of which are not shipped in the Linux kernel. Note that follow-up commits will update acpidump to use this new API to improve portability. Lv Zheng. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/acpica/utdebug.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/acpi/acpica/utdebug.c b/drivers/acpi/acpica/utdebug.c
index 21a20ac5b1e1..e516254c63b2 100644
--- a/drivers/acpi/acpica/utdebug.c
+++ b/drivers/acpi/acpica/utdebug.c
@@ -561,3 +561,29 @@ acpi_ut_ptr_exit(u32 line_number,
561} 561}
562 562
563#endif 563#endif
564
565#ifdef ACPI_APPLICATION
566/*******************************************************************************
567 *
568 * FUNCTION: acpi_log_error
569 *
570 * PARAMETERS: format - Printf format field
571 * ... - Optional printf arguments
572 *
573 * RETURN: None
574 *
575 * DESCRIPTION: Print error message to the console, used by applications.
576 *
577 ******************************************************************************/
578
579void ACPI_INTERNAL_VAR_XFACE acpi_log_error(const char *format, ...)
580{
581 va_list args;
582
583 va_start(args, format);
584 (void)acpi_ut_file_vprintf(ACPI_FILE_ERR, format, args);
585 va_end(args);
586}
587
588ACPI_EXPORT_SYMBOL(acpi_log_error)
589#endif