From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63094CA9EC0 for ; Thu, 24 Oct 2019 19:13:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 43D5021D7F for ; Thu, 24 Oct 2019 19:13:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392897AbfJXTNr (ORCPT ); Thu, 24 Oct 2019 15:13:47 -0400 Received: from mga01.intel.com ([192.55.52.88]:56949 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392928AbfJXTNr (ORCPT ); Thu, 24 Oct 2019 15:13:47 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Oct 2019 12:13:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,225,1569308400"; d="scan'208";a="188686292" Received: from sibelius.jf.intel.com ([10.54.75.23]) by orsmga007.jf.intel.com with ESMTP; 24 Oct 2019 12:13:43 -0700 From: Erik Schmauss To: "Rafael J . Wysocki" , linux-acpi@vger.kernel.org Cc: Erik Schmauss , Bob Moore Subject: [PATCH 11/12] ACPICA: debugger: remove leading whitespaces when converting a string to a buffer Date: Thu, 24 Oct 2019 11:55:55 -0700 Message-Id: <20191024185556.4606-12-erik.schmauss@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191024185556.4606-1-erik.schmauss@intel.com> References: <20191024185556.4606-1-erik.schmauss@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org ACPICA commit 1b7228072f254a5b02625586ff7d561757b7fc2d By removing leading whitespaces, the conversion computes the correct number of elements in a given buffer or field encoding that contains leading whitespaces. Link: https://github.com/acpica/acpica/commit/1b722807 Signed-off-by: Erik Schmauss Signed-off-by: Bob Moore --- drivers/acpi/acpica/dbconvert.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/acpi/acpica/dbconvert.c b/drivers/acpi/acpica/dbconvert.c index 9fd9a98a9cbe..2b84ac093698 100644 --- a/drivers/acpi/acpica/dbconvert.c +++ b/drivers/acpi/acpica/dbconvert.c @@ -106,6 +106,10 @@ acpi_db_convert_to_buffer(char *string, union acpi_object *object) u8 *buffer; acpi_status status; + /* Skip all preceding white space */ + + acpi_ut_remove_whitespace(&string); + /* Generate the final buffer length */ for (i = 0, length = 0; string[i];) { -- 2.21.0