From patchwork Thu May 21 02:37:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1294903 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 49SDLw3Qmlz9sRf; Thu, 21 May 2020 12:38:16 +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 1jbb66-00077U-1n; Thu, 21 May 2020 02:38:14 +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 1jbb63-00076g-To for fwts-devel@lists.ubuntu.com; Thu, 21 May 2020 02:38:11 +0000 Received: from 2.general.alexhung.us.vpn ([10.172.65.255] 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 1jbb63-0002SP-8z; Thu, 21 May 2020 02:38:11 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH 02/10] dmicheck: remove duplicated chassis type test in type 3 Date: Wed, 20 May 2020 20:37:54 -0600 Message-Id: <20200521023802.1553594-2-alex.hung@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200521023802.1553594-1-alex.hung@canonical.com> References: <20200521023802.1553594-1-alex.hung@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" Signed-off-by: Alex Hung Acked-by: Colin Ian King Acked-by: Ivan Hu --- src/dmi/dmicheck/dmicheck.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c index 46d7e620..f163c253 100644 --- a/src/dmi/dmicheck/dmicheck.c +++ b/src/dmi/dmicheck/dmicheck.c @@ -1270,16 +1270,7 @@ static void dmicheck_entry(fwts_framework *fw, if (hdr->length < 0x09) break; dmi_str_check(fw, table, addr, "Manufacturer", hdr, 0x4); - dmi_min_max_mask_uint8_check(fw, table, addr, "Chassis Type", hdr, 0x5, 0x1, 0x24, 0x0, 0x7f); - - if ((data[5] & ~0x80) >= FWTS_SMBIOS_CHASSIS_MAX) { - fwts_failed(fw, LOG_LEVEL_HIGH, DMI_INVALID_HARDWARE_ENTRY, - "Incorrect Chassis Type " - "SMBIOS Type 3 reports 0x%" PRIx8, - (data[5] & ~0x80)); - break; - } - + dmi_min_max_mask_uint8_check(fw, table, addr, "Chassis Type", hdr, 0x5, 0x1, FWTS_SMBIOS_CHASSIS_MAX - 1, 0x0, 0x7f); dmi_min_max_mask_uint8_check(fw, table, addr, "Chassis Lock", hdr, 0x5, 0x0, 0x1, 0x7, 0x1); dmi_str_check(fw, table, addr, "Version", hdr, 0x6); dmi_str_check(fw, table, addr, "Serial Number", hdr, 0x7);