Skip to content

Commit

Permalink
ACPICA: Applications: Fix a potential issue that help messages may be…
Browse files Browse the repository at this point in the history
… 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 <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Lv Zheng authored and Rafael J. Wysocki committed Aug 13, 2016
1 parent dd99cbc commit 911a9b8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/acpi/acpica/acapps.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down

0 comments on commit 911a9b8

Please sign in to comment.