From patchwork Fri Aug 13 17:02:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1516724 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; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=Bn5KAsdk; dkim-atps=neutral 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 4GmVHC40Yzz9sX5 for ; Sat, 14 Aug 2021 03:02:46 +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 1mEaZv-0003bs-7l; Fri, 13 Aug 2021 17:02:43 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mEaZn-0003bT-Ba for fwts-devel@lists.ubuntu.com; Fri, 13 Aug 2021 17:02:35 +0000 Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPS id 3E21340664 for ; Fri, 13 Aug 2021 17:02:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1628874155; bh=xwK6A1YcvErBx+M0iaera3VXpMQufUgysyRVq8hwtZM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Bn5KAsdkJcYjBOXAZxDI64NLwnIRuN5WrmcO+H/StG7lTcSFvPNO6bTsu6BEiaNfH pxdBAieJD4S3h8RRfVXy2rf39Logn2LPKsL84dMvK27qw2sndNzFXr90n5D9htINnO oJdws9oqHyoGFWc+QCsXqMEvspCsPk7QZFg5c4/Mj0a4PuQAfxNViGtNlUhqUK6cw0 sqMymHNzub04KayA6SdsynEqg/yNUd34U8um18oWMDswI3ogePYOn/jsT2eNUIMd+8 yhFiKBb19ueZpZNu7E/8WqAAqb3/AiL91NbZCRgF65VifRNocKphsuJ7kV9hK8Pp1A r3wnAsjrP4kWg== Received: by mail-pl1-f199.google.com with SMTP id u8-20020a17090341c8b029012d5f2333bfso6492169ple.13 for ; Fri, 13 Aug 2021 10:02:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xwK6A1YcvErBx+M0iaera3VXpMQufUgysyRVq8hwtZM=; b=m2NetEaRfAh1xtpxgXQZ2Mrm4sYZiWBKFfzZ8t6Jx60JFEevdY/OVgzpuEUcJvrr6S J0iobZxAkg3h1dx/yExeJNLhq60NBI9gy3CDQyxm1f/JRugqQRJSKElyJUYH/BTKjM4J 9CJ9Ienksu8PJKpgvrP3Sj1qY67Te3PuO8dSCrUp8wqdN+nkwqrrGm5IMtvtAPwj4AA2 JwTyQkR6V9JwU6hxB2PRaDS1Oxe/nsyB3nTCnJzzWezPehGaI47pKNksenyut1FfiC8/ jiwn6rK+kAOHWC7O35JYnkw6lY0XMNzDLQTRaX9sI1xi3UZ3m0ipgiEO9pODXRmWlW2k GFWw== X-Gm-Message-State: AOAM530Ct21NO51vccwsRorasOmsfnUGcFGK5035ODsPU9vvrX/Tre2A KYUs3cclPyRQZb7cvfjv7foMcvg8d40+g0nwPUZvhEC6KE0HnOP2TOrZpftmtLOQCYxw44tJi7T tXIfaf19nAOXP5JhfROhQcI100C+oeo4DdhDrI/o9 X-Received: by 2002:a05:6a00:139d:b0:3e1:7fc:121d with SMTP id t29-20020a056a00139d00b003e107fc121dmr2642197pfg.50.1628874153465; Fri, 13 Aug 2021 10:02:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8yvdC2knOf/u9SJYjlgphK8K4XWIQl0BBERDVfpvj5Gf35D5+gXzBHl1t1cb7CT5JkpOgZg== X-Received: by 2002:a05:6a00:139d:b0:3e1:7fc:121d with SMTP id t29-20020a056a00139d00b003e107fc121dmr2642185pfg.50.1628874153261; Fri, 13 Aug 2021 10:02:33 -0700 (PDT) Received: from canonical.com (node-1w7jr9yeotzddnlkq9kweiluf.ipv6.telus.net. [2001:56a:7943:7600::d17]) by smtp.gmail.com with ESMTPSA id 22sm3373092pgn.88.2021.08.13.10.02.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Aug 2021 10:02:32 -0700 (PDT) From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH 2/2] acpi: fadt: remove hard-coded FADT version Date: Fri, 13 Aug 2021 11:02:29 -0600 Message-Id: <20210813170229.472683-2-alex.hung@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210813170229.472683-1-alex.hung@canonical.com> References: <20210813170229.472683-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" FADT version is the same as ACPI version, and minor is only the lower 4 bits since ACPI 6.4. Signed-off-by: Alex Hung Acked-by: Ivan Hu Acked-by: Colin Ian King --- src/acpi/fadt/fadt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/acpi/fadt/fadt.c b/src/acpi/fadt/fadt.c index acf767e5..fc8b5987 100644 --- a/src/acpi/fadt/fadt.c +++ b/src/acpi/fadt/fadt.c @@ -196,15 +196,15 @@ static int fadt_checksum(fwts_framework *fw) static int fadt_revision(fwts_framework *fw) { - const uint8_t LATEST_MAJOR = 6; - const uint8_t LATEST_MINOR = 3; + const uint8_t LATEST_MAJOR = (FWTS_ACPI_VERSION_NOW & 0xF00) >> 8; + const uint8_t LATEST_MINOR = (FWTS_ACPI_VERSION_NOW & 0xFF) >> 4; uint8_t major; uint8_t minor; major = fadt->header.revision; minor = 0; if (major >= 5 && fadt->header.length >= 268) - minor = fadt->minor_version; /* field added ACPI 5.1 */ + minor = fadt->minor_version & 0xF; /* field added ACPI 5.1 */ fwts_log_info(fw, "FADT revision: %" PRIu8 ".%" PRIu8, major, minor); fwts_log_info(fw, "FADT table length: %" PRIu32, fadt->header.length);