From: Lv Zheng Date: Thu, 4 Aug 2016 08:45:22 +0000 (+0800) Subject: ACPICA: Applications: Fix a potential issue that help messages may be dumped to acpi_... X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=911a9b842874f52429d0b0a420bf0fed22117611;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git ACPICA: Applications: Fix a potential issue that help messages may be dumped to acpi_gbl_debug_file ACPICA commit d1b7372c7eb89cdba3d3c239fb07e2fdc5abf880 This is a regression fix, restoring usage macro to its original implementation. There is an issue for usage macros, if an command line option changed acpi_gbl_debug_file, then the follow up usage message may be errornously dumped to the debug file. This is just a bug in theory, because currently acpi_gbl_debug_file can only be modified by acpibin and acpiexec. And this will not trigger such issue because: 1. For acpibin, acpi_gbl_debug_file will be modified by "-t" option and the program exits after processing this option without dumping help message or other error options. 2. For acpiexec, acpi_gbl_debug_file will only be modified by the open command, which happens after parsing the command line options, so no help message will be dumped into the debug file. But maintaining this logic is difficult, so this patch modifies acpi_os_printf() into printf() for usage macros so that the help messages are ensured to be dumped to the stdout. Lv Zheng. Link: https://github.com/acpica/acpica/commit/d1b7372c Link: https://bugs.acpica.org/show_bug.cgi?id=1142 Signed-off-by: Lv Zheng Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/acpi/acpica/acapps.h b/drivers/acpi/acpica/acapps.h index bc385347932e..0bd6307e1f3c 100644 --- a/drivers/acpi/acpica/acapps.h +++ b/drivers/acpi/acpica/acapps.h @@ -83,13 +83,13 @@ /* Macros for usage messages */ #define ACPI_USAGE_HEADER(usage) \ - acpi_os_printf ("Usage: %s\nOptions:\n", usage); + printf ("Usage: %s\nOptions:\n", usage); #define ACPI_USAGE_TEXT(description) \ - acpi_os_printf (description); + printf (description); #define ACPI_OPTION(name, description) \ - acpi_os_printf (" %-20s%s\n", name, description); + printf (" %-20s%s\n", name, description); /* Check for unexpected exceptions */