From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lv Zheng Subject: [PATCH 30/31] ACPICA: Fix a couple issues with the local printf module. Date: Mon, 13 Apr 2015 11:51:23 +0800 Message-ID: <3fc1096061ea22272c2a68f05171bebc9caf24e5.1428893939.git.lv.zheng@intel.com> References: Return-path: Received: from mga09.intel.com ([134.134.136.24]:8713 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932123AbbDMDv2 (ORCPT ); Sun, 12 Apr 2015 23:51:28 -0400 In-Reply-To: Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: "Rafael J. Wysocki" , Len Brown Cc: Lv Zheng , Lv Zheng , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Bob Moore ACPICA commit 6853da4c0a99b49d62d6c58d22956cd6ff5759a9 The following commit has fixed local printf issue in width.prec: Commit: 3589b8b8af6bdc3aafe520d76a73b77d965006b6 Subject: ACPICA: Utilities: Fix local printf issue. But this commit only resets width/precision/quialifier to fix the reported issue and doesn't fix other states issues. So now we still can see breakage in format types and integer bases. This patch resets format type/base states for local printf to fix this issue. Lv Zheng. Linux kernel is not affected by this patch as acpi_ut_vsnprintf() hasn't been enabled in the kernel. Link: https://github.com/acpica/acpica/commit/6853da4c Signed-off-by: Lv Zheng Signed-off-by: Bob Moore --- drivers/acpi/acpica/utprint.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/acpica/utprint.c b/drivers/acpi/acpica/utprint.c index 82ca914..2be6bd4 100644 --- a/drivers/acpi/acpica/utprint.c +++ b/drivers/acpi/acpica/utprint.c @@ -357,11 +357,11 @@ int acpi_ut_vsnprintf(char *string, acpi_size size, const char *format, va_list args) { - u8 base = 10; - u8 type = 0; - s32 width = -1; - s32 precision = -1; - char qualifier = 0; + u8 base; + u8 type; + s32 width; + s32 precision; + char qualifier; u64 number; char *pos; char *end; @@ -380,6 +380,9 @@ acpi_ut_vsnprintf(char *string, continue; } + type = 0; + base = 10; + /* Process sign */ do { -- 1.7.10 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753755AbbDMDve (ORCPT ); Sun, 12 Apr 2015 23:51:34 -0400 Received: from mga09.intel.com ([134.134.136.24]:8713 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932123AbbDMDv2 (ORCPT ); Sun, 12 Apr 2015 23:51:28 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,568,1422950400"; d="scan'208";a="679119543" From: Lv Zheng To: "Rafael J. Wysocki" , Len Brown Cc: Lv Zheng , Lv Zheng , , linux-acpi@vger.kernel.org, Bob Moore Subject: [PATCH 30/31] ACPICA: Fix a couple issues with the local printf module. Date: Mon, 13 Apr 2015 11:51:23 +0800 Message-Id: <3fc1096061ea22272c2a68f05171bebc9caf24e5.1428893939.git.lv.zheng@intel.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ACPICA commit 6853da4c0a99b49d62d6c58d22956cd6ff5759a9 The following commit has fixed local printf issue in width.prec: Commit: 3589b8b8af6bdc3aafe520d76a73b77d965006b6 Subject: ACPICA: Utilities: Fix local printf issue. But this commit only resets width/precision/quialifier to fix the reported issue and doesn't fix other states issues. So now we still can see breakage in format types and integer bases. This patch resets format type/base states for local printf to fix this issue. Lv Zheng. Linux kernel is not affected by this patch as acpi_ut_vsnprintf() hasn't been enabled in the kernel. Link: https://github.com/acpica/acpica/commit/6853da4c Signed-off-by: Lv Zheng Signed-off-by: Bob Moore --- drivers/acpi/acpica/utprint.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/acpica/utprint.c b/drivers/acpi/acpica/utprint.c index 82ca914..2be6bd4 100644 --- a/drivers/acpi/acpica/utprint.c +++ b/drivers/acpi/acpica/utprint.c @@ -357,11 +357,11 @@ int acpi_ut_vsnprintf(char *string, acpi_size size, const char *format, va_list args) { - u8 base = 10; - u8 type = 0; - s32 width = -1; - s32 precision = -1; - char qualifier = 0; + u8 base; + u8 type; + s32 width; + s32 precision; + char qualifier; u64 number; char *pos; char *end; @@ -380,6 +380,9 @@ acpi_ut_vsnprintf(char *string, continue; } + type = 0; + base = 10; + /* Process sign */ do { -- 1.7.10