lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Tue, 20 Mar 2012 09:53:13 +0100
From:	Corentin Chary <corentin.chary@...il.com>
To:	Matthew Garrett <mjg@...hat.com>
Cc:	platform-driver-x86@...r.kernel.org,
	Corentin Chary <corentin.chary@...il.com>,
	Corentin Chary <corentincj@...aif.net>,
	acpi4asus-user@...ts.sourceforge.net, linux-kernel@...r.kernel.org
Subject: [PATCH 13/14] eeepc-wmi: split et2012 specific hacks

Signed-off-by: Corentin Chary <corentin.chary@...il.com>
---
 drivers/platform/x86/eeepc-wmi.c |   34 ++++++++++++++++++++--------------
 1 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c
index 0bb0aaf..6567613 100644
--- a/drivers/platform/x86/eeepc-wmi.c
+++ b/drivers/platform/x86/eeepc-wmi.c
@@ -109,26 +109,32 @@ static struct quirk_entry quirk_asus_et2012_type3 = {
 
 static struct quirk_entry *quirks;
 
+static void et2012_quirks(void)
+{
+	const struct dmi_device *dev = NULL;
+	char oemstring[30];
+
+	while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
+		if (sscanf(dev->name, "AEMS%24c", oemstring) == 1) {
+			if (oemstring[18] == '1')
+				quirks = &quirk_asus_et2012_type1;
+			else if (oemstring[18] == '3')
+				quirks = &quirk_asus_et2012_type3;
+			break;
+		}
+	}
+}
+
 static int dmi_matched(const struct dmi_system_id *dmi)
 {
 	char *model;
+
 	quirks = dmi->driver_data;
 
 	model = (char *)dmi->matches[1].substr;
-	if (unlikely(strncmp(model, "ET2012", 6) == 0)) {
-		const struct dmi_device *dev = NULL;
-		char oemstring[30];
-		while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING,
-					      NULL, dev))) {
-			if (sscanf(dev->name, "AEMS%24c", oemstring) == 1) {
-				if (oemstring[18] == '1')
-					quirks = &quirk_asus_et2012_type1;
-				else if (oemstring[18] == '3')
-					quirks = &quirk_asus_et2012_type3;
-				break;
-			}
-		}
-	}
+	if (unlikely(strncmp(model, "ET2012", 6) == 0))
+		et2012_quirks();
+
 	return 1;
 }
 
-- 
1.7.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ