Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9322766ybl; Fri, 17 Jan 2020 09:58:30 -0800 (PST) X-Google-Smtp-Source: APXvYqwGSK+X2/tGx+idPvx1RlrB3CWv1Gzb7AAMzPDzlIElm/ZWJouoR9Q2Ztgi3l7I572CpQ3N X-Received: by 2002:a9d:6f11:: with SMTP id n17mr6949268otq.126.1579283909961; Fri, 17 Jan 2020 09:58:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579283909; cv=none; d=google.com; s=arc-20160816; b=kN6nmb2xtqy6Q8B8U4QEMbQYcrucV2fQJGTkzvmYuKM3fKDsFavFRA/J8e0EE6YldI WrCFOHGQiVkEzofaYZa5NsjrHE9ev1KeNl8VDlBuStNZWSthHLzzPsoYHmI0nAJTbaht nmIW4hHxDCmyG4CDWsp9L+glax3cjotapNk5lQqZwKzoIaBBRfZJkOzXF7DCfSuUw2EW 8Q2IZA5Vu/OKbwGDv/YfskWhd1bA/5747AL1ovQL276snTHUIpvh5hz7ws4Q2wngK0Un 6JqUncMqTY6AcsumC0HjMs9yLSyrRvC9ecV4RW6t0jhYWFqXmM+7748xVC0MQywYLj+4 rW6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=+o7F+mVYBKU0jTZP70M6LwjU/HDvNrmFNmz9lIv8ZQ8=; b=AGy84VhGDHwGrPQ/hDNOYyRwY6XSBRXjFQclFHcBWlSyNrdAk6xYlzev4Z39ph4eWE StAXcydP8pZX28KrDdjhBtYCsilF97cDYyycNmPF0kO/VNUUbKalwaBwRIiLr4Nahezt iqvV7QaLF0DXJVWPHFNPpVGwpo4391isB0XD9Os9rTwPrvsAzpd/ejm3HY130PdJMmG+ Anxi42cW0tKdD3JGVnXiqCCGgrhgqbz6kq89gOEY9MhnIuA/ezt1QEzNVN696m7HRUqg YTcOoT3CLfZALIMvan0StPAoQougG2ksa5IXeqmPL++8n+O1NrAaexekPivY7DX5ZWOi KwJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u16si15051501otq.92.2020.01.17.09.58.18; Fri, 17 Jan 2020 09:58:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729320AbgAQR4w (ORCPT + 99 others); Fri, 17 Jan 2020 12:56:52 -0500 Received: from mga11.intel.com ([192.55.52.93]:62787 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727573AbgAQR4b (ORCPT ); Fri, 17 Jan 2020 12:56:31 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jan 2020 09:56:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,331,1574150400"; d="scan'208";a="243739401" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 17 Jan 2020 09:56:27 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 08CC3109; Fri, 17 Jan 2020 19:56:27 +0200 (EET) From: Andy Shevchenko To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, Alessandro Zummo , Alexandre Belloni , linux-rtc@vger.kernel.org, "Guilherme G . Piccoli" , linux-kernel@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v1 4/8] x86/quirks: Convert DMI matching to use a table Date: Fri, 17 Jan 2020 19:56:22 +0200 Message-Id: <20200117175626.56358-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200117175626.56358-1-andriy.shevchenko@linux.intel.com> References: <20200117175626.56358-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In order to extend the DMI based quirks, convert them to a table. Signed-off-by: Andy Shevchenko --- arch/x86/kernel/quirks.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c index 5b96654aacc0..447d4fba8516 100644 --- a/arch/x86/kernel/quirks.c +++ b/arch/x86/kernel/quirks.c @@ -667,8 +667,31 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2083, quirk_intel_purley_xeon_ras bool x86_apple_machine; EXPORT_SYMBOL(x86_apple_machine); +static int apple_machine_cb(const struct dmi_system_id *id) +{ + x86_apple_machine = true; + return 1; +} + +static const struct dmi_system_id x86_machine_table[] = { + { + .ident = "x86 Apple Macintosh", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), + }, + .callback = apple_machine_cb, + }, + { + .ident = "x86 Apple Macintosh", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Apple Computer, Inc."), + }, + .callback = apple_machine_cb, + }, + {} +}; + void __init early_platform_quirks(void) { - x86_apple_machine = dmi_match(DMI_SYS_VENDOR, "Apple Inc.") || - dmi_match(DMI_SYS_VENDOR, "Apple Computer, Inc."); + dmi_check_system(x86_machine_table); } -- 2.24.1