From patchwork Tue Aug 25 16:29:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 510562 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 283CB140081; Wed, 26 Aug 2015 02:30:22 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1ZUH76-0007oO-0Z; Tue, 25 Aug 2015 16:30:20 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1ZUH71-0007oJ-6z for fwts-devel@lists.ubuntu.com; Tue, 25 Aug 2015 16:30:15 +0000 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1ZUH71-0007Zl-3L for fwts-devel@lists.ubuntu.com; Tue, 25 Aug 2015 16:30:15 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH] acpi: rsdp: make OEM ID test less strict Date: Tue, 25 Aug 2015 17:29:42 +0100 Message-Id: <1440520182-21309-1-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 2.5.0 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.14 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-bounces@lists.ubuntu.com From: Colin Ian King The coreboot folk have noted that the OEM ID test is too strict and perhaps isprint() should be used instead to check for bad OEM ID strings as this makes more sense and allows spaces and other printable characters. Reported-by: Patrick Georgi Signed-off-by: Colin Ian King Acked-by: Alex Hung Acked-by: Ivan Hu --- src/acpi/rsdp/rsdp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/acpi/rsdp/rsdp.c b/src/acpi/rsdp/rsdp.c index 2fe530b..ce5137f 100644 --- a/src/acpi/rsdp/rsdp.c +++ b/src/acpi/rsdp/rsdp.c @@ -52,16 +52,16 @@ static int rsdp_test1(fwts_framework *fw) size_t i; for (i = 0; i < 6; i++) { - if (!isalnum(rsdp->oem_id[i])) { + if (!isprint(rsdp->oem_id[i])) { passed = false; break; } } if (!passed) { - fwts_failed(fw, LOG_LEVEL_MEDIUM, + fwts_failed(fw, LOG_LEVEL_LOW, "RSDPBadOEMId", - "RSDP: oem_id does not contain any alpha " - "numeric characters."); + "RSDP: oem_id contains non-printable " + "characters."); fwts_advice(fw, "The RSDP OEM Id is non-conforming, but this " "will not affect the system behaviour. However "