From patchwork Wed Nov 25 04:26:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ivan Hu X-Patchwork-Id: 1405875 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) 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-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cgnrs4rlrz9sRK for ; Wed, 25 Nov 2020 15:26:20 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1khmNh-0005AW-L6; Wed, 25 Nov 2020 04:26:13 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1khmNg-00059s-Is for fwts-devel@lists.ubuntu.com; Wed, 25 Nov 2020 04:26:12 +0000 Received: from 123-204-8-227.dynamic.seed.net.tw ([123.204.8.227] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1khmNf-00049g-O9 for fwts-devel@lists.ubuntu.com; Wed, 25 Nov 2020 04:26:12 +0000 From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH] lib: fwts_acpi_table.c: fix build fail Date: Wed, 25 Nov 2020 12:26:06 +0800 Message-Id: <20201125042606.28537-1-ivan.hu@canonical.com> X-Mailer: git-send-email 2.17.1 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" fwts_acpi_tables.c: In function ‘fwts_acpi_is_reduced_hardware’: fwts_acpi_tables.c:293:10: error: implicit conversion from ‘enum ’ to ‘fwts_bool’ [-Werror=enum-conversion] 293 | return FWTS_ERROR; | ^~~~~~~~~~ fwts_acpi_tables.c:297:10: error: implicit conversion from ‘enum ’ to ‘fwts_bool’ [-Werror=enum-conversion] 297 | return FWTS_ERROR; | ^~~~~~~~~~ Also modify some codes for affecting the patch, lib: refactor fwts_acpi_is_reduced_hardware Signed-off-by: Ivan Hu Acked-by: Alex Hung Acked-by: Colin Ian King --- src/lib/src/fwts_acpi_tables.c | 6 +++--- src/sbbr/fadt/fadt.c | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c index f0a809eb..248f8ae1 100644 --- a/src/lib/src/fwts_acpi_tables.c +++ b/src/lib/src/fwts_acpi_tables.c @@ -290,11 +290,11 @@ fwts_bool fwts_acpi_is_reduced_hardware(fwts_framework *fw) if (fwts_acpi_find_table(fw, "FACP", 0, &table) != FWTS_OK) { fwts_log_error(fw, "Cannot read ACPI table FACP."); - return FWTS_ERROR; + return FWTS_BOOL_ERROR; } if (table == NULL) { fwts_log_error(fw, "ACPI table FACP does not exist!"); - return FWTS_ERROR; + return FWTS_BOOL_ERROR; } fadt = (const fwts_acpi_table_fadt *) table->data; @@ -415,7 +415,7 @@ PRAGMA_PACK_WARN_OFF PRAGMA_POP if (result != FWTS_OK) { if ((result == FWTS_NULL_POINTER) && - fwts_acpi_is_reduced_hardware(fw)) { + (fwts_acpi_is_reduced_hardware(fw) == FWTS_TRUE)) { fwts_log_info(fw, "Ignore the missing FACS. " "It is optional in hardware-reduced mode"); } else { diff --git a/src/sbbr/fadt/fadt.c b/src/sbbr/fadt/fadt.c index c02c84e9..35ba5d15 100644 --- a/src/sbbr/fadt/fadt.c +++ b/src/sbbr/fadt/fadt.c @@ -93,11 +93,12 @@ static int fadt_sbbr_reduced_hw_test2(fwts_framework *fw) uint32_t flag_mask; rhw = fwts_acpi_is_reduced_hardware(fw); - if (rhw == 0) + if (rhw == FWTS_FALSE) fwts_failed(fw, LOG_LEVEL_CRITICAL, "fadt_reduced_hw:", "FADT indicates ACPI is not in reduced hardware mode."); - else + else if(rhw == FWTS_TRUE) fwts_passed(fw, "FADT indicates ACPI is in reduced hardware mode."); - + else + fwts_failed(fw, LOG_LEVEL_HIGH, "fadt_reduced_hw:", "ACPI table reads error."); if (!rhw) return FWTS_OK;