From patchwork Wed Aug 15 13:11:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 957892 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41r8xp0rSpz9sCD; Wed, 15 Aug 2018 23:11:58 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1fpvac-000435-0p; Wed, 15 Aug 2018 13:11:54 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1fpvaP-0003s2-5a for fwts-devel@lists.ubuntu.com; Wed, 15 Aug 2018 13:11:41 +0000 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1fpvaO-00087N-7w; Wed, 15 Aug 2018 13:11:40 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH 20/27] acpi: stao: add in missing const to fix build warnings Date: Wed, 15 Aug 2018 14:11:22 +0100 Message-Id: <20180815131129.24146-21-colin.king@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180815131129.24146-1-colin.king@canonical.com> References: <20180815131129.24146-1-colin.king@canonical.com> MIME-Version: 1.0 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" From: Colin Ian King Add in missing const, cleans up warnings. Signed-off-by: Colin Ian King Acked-by: Alex Hung Acked-by: Ivan Hu --- src/acpi/stao/stao.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/acpi/stao/stao.c b/src/acpi/stao/stao.c index 56df440b..537e364f 100644 --- a/src/acpi/stao/stao.c +++ b/src/acpi/stao/stao.c @@ -50,12 +50,12 @@ static int stao_init(fwts_framework *fw) */ static bool stao_acpi_string( fwts_framework *fw, - char *str, - char *end, + const char *str, + const char *end, bool *passed, size_t *len) { - char *ptr = str; + const char *ptr = str; while (*ptr) { if (ptr > end) { @@ -82,7 +82,7 @@ static int stao_test1(fwts_framework *fw) { const fwts_acpi_table_stao *stao = (const fwts_acpi_table_stao *)table->data; bool passed = true; - char *ptr, *end; + const char *ptr, *end; int strings = 0; if (stao->header.length > (uint32_t)table->length) { @@ -101,8 +101,8 @@ static int stao_test1(fwts_framework *fw) fwts_log_info_verbatim(fw, "STAO Status Override Table:"); fwts_log_info_verbatim(fw, " UART: 0x%2.2" PRIx8, stao->uart); - ptr = (char *)stao->namelist; - end = (char *)table->data + stao->header.length; + ptr = (const char *)stao->namelist; + end = (const char *)table->data + stao->header.length; while (ptr < end) { size_t len; @@ -118,8 +118,8 @@ static int stao_test1(fwts_framework *fw) if (!strings) goto done; - ptr = (char *)stao->namelist; - end = (char *)table->data + table->length; + ptr = (const char *)stao->namelist; + end = (const char *)table->data + table->length; while (ptr < end) { bool found;