From patchwork Wed Aug 15 22:55:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 958055 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 41rPvk22Bfz9s8T; Thu, 16 Aug 2018 08:56:02 +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 1fq4hq-0000RB-QA; Wed, 15 Aug 2018 22:55:58 +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 1fq4hq-0000R5-06 for fwts-devel@lists.ubuntu.com; Wed, 15 Aug 2018 22:55:58 +0000 Received: from 2.general.alexhung.us.vpn ([10.172.65.255] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1fq4hp-0003qN-AV; Wed, 15 Aug 2018 22:55:57 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH] acpiinfo: update acpi version supported by kernel Date: Wed, 15 Aug 2018 15:55:54 -0700 Message-Id: <20180815225554.20128-1-alex.hung@canonical.com> X-Mailer: git-send-email 2.17.1 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: , MIME-Version: 1.0 Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" ACPI version is formated as major.minor, and therefore float is used to replace int. In addition, two indents are also fixed. Signed-off-by: Alex Hung Acked-by: Colin Ian King Acked-by: Ivan Hu --- src/acpi/acpiinfo/acpiinfo.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/acpi/acpiinfo/acpiinfo.c b/src/acpi/acpiinfo/acpiinfo.c index d3aa6b2a..b96f7b1c 100644 --- a/src/acpi/acpiinfo/acpiinfo.c +++ b/src/acpi/acpiinfo/acpiinfo.c @@ -68,30 +68,34 @@ static int acpiinfo_test1(fwts_framework *fw) if (((str = fwts_get("/sys/module/acpi/parameters/acpica_version")) == NULL) && ((str = fwts_get("/proc/acpi/info")) == NULL)) - fwts_log_info(fw, + fwts_log_info(fw, "Cannot get ACPI version info from " "/sys/module/acpi/parameters/acpica_version or /proc/acpi/info"); - else { - int version; + else { + float version; int yearmonth; fwts_chop_newline(str); sscanf(str, "%6d", &yearmonth); - if (yearmonth > 201505) { - version = 6; + if (yearmonth > 201609) { + version = 6.2; + } else if (yearmonth > 201509) { + version = 6.1; + } else if (yearmonth > 201404) { + version = 6.0; } else if (yearmonth > 201110) { - version = 5; + version = 5.0; } else if (yearmonth > 200906) { - version = 4; + version = 4.0; } else if (yearmonth > 200505) { - version = 3; + version = 3.0; } else { - version = 2; + version = 2.0; } - fwts_log_info(fw, "Kernel ACPICA driver version: %s, supports ACPI %d.0", str, version); + fwts_log_info(fw, "Kernel ACPICA driver version: %s, supports ACPI %2.1f", str, version); free(str); }