OSDN Git Service

ACPICA: Utilities: Fix an issue with non-native ACPI_IS_PRINT()
authorLv Zheng <lv.zheng@intel.com>
Tue, 8 Jul 2014 02:06:05 +0000 (10:06 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 8 Jul 2014 12:22:25 +0000 (14:22 +0200)
An error was found in the ACPICA provided non-native ACPI_IS_PRINT() causing the
following difference with the native isprint() implementation:
  The GNU libc isprint('\n') test result:
   isprint(0x20) is FALSE
  The Linux kernel isprint('\n') test result:
   ACPI: isprint(0x20) is FALSE
  The _acpi_ctype isprint('\n') test result:
   isprint(0x20) is TRUE

The ACPI_IS_PRINT() macro generated for _acpi_ctype is wrong. It should use
_ACPI_XS instead of _ACPI_SP.  _ACPI_XS is white space only. Other space
characters should be non printable.

This patch fixes this issue. For OSPMs that are using native standard
isprint() implementations, this patch is a no-op. 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>
drivers/acpi/acpica/acutils.h

index 1e256c5..caeb81a 100644 (file)
@@ -257,7 +257,7 @@ extern const u8 _acpi_ctype[];
 #define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD))
 #define ACPI_IS_UPPER(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP))
 #define ACPI_IS_LOWER(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO))
-#define ACPI_IS_PRINT(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU))
+#define ACPI_IS_PRINT(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_XS | _ACPI_PU))
 #define ACPI_IS_ALPHA(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP))
 
 #endif                         /* !ACPI_USE_SYSTEM_CLIBRARY */