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]
Message-Id: <1242850139-25438-2-git-send-email-jirislaby@gmail.com>
Date:	Wed, 20 May 2009 22:08:58 +0200
From:	Jiri Slaby <jirislaby@...il.com>
To:	linville@...driver.com
Cc:	mickflemm@...il.com, lrodriguez@...eros.com, me@...copeland.com,
	linux-wireless@...r.kernel.org, ath5k-devel@...ema.h4ckr.net,
	linux-kernel@...r.kernel.org, Jiri Slaby <jirislaby@...il.com>
Subject: [PATCH 2/3] ath5k: led, cleanup and prepare macros

From: Jiri Slaby <jirislaby@...il.com>

We need to use driver_data for more than pin and polaroty data.
Remove driver_data designator from ATH_LED definition and write
it explicitly.

Signed-off-by: Jiri Slaby <jirislaby@...il.com>
---
 drivers/net/wireless/ath/ath5k/led.c |   33 +++++++++++++++++++++------------
 1 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/led.c b/drivers/net/wireless/ath/ath5k/led.c
index 762e40d..0374b1f 100644
--- a/drivers/net/wireless/ath/ath5k/led.c
+++ b/drivers/net/wireless/ath/ath5k/led.c
@@ -47,30 +47,39 @@
 	.vendor = PCI_ANY_ID, .device = PCI_ANY_ID, \
 	.subvendor = (subv), .subdevice = (subd)
 
-#define ATH_LED(pin,polarity) .driver_data = (((pin) << 8) | (polarity))
-#define ATH_PIN(data) ((data) >> 8)
-#define ATH_POLARITY(data) ((data) & 0xff)
+#define ATH_LED(pin, polarity)	(((pin) << 8) | (polarity))
+#define ATH_PIN(data)		(((data) >> 8) & 0xffff)
+#define ATH_POLARITY(data)	((data) & 0xff)
 
 /* Devices we match on for LED config info (typically laptops) */
 static const struct pci_device_id ath5k_led_devices[] = {
 	/* AR5211 */
-	{ PCI_VDEVICE(ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5211), ATH_LED(0, 0) },
+	{ PCI_VDEVICE(ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5211),
+			.driver_data = ATH_LED(0, 0) },
 	/* HP Compaq nc6xx, nc4000, nx6000 */
-	{ ATH_SDEVICE(PCI_VENDOR_ID_COMPAQ, PCI_ANY_ID), ATH_LED(1, 1) },
+	{ ATH_SDEVICE(PCI_VENDOR_ID_COMPAQ, PCI_ANY_ID),
+			.driver_data = ATH_LED(1, 1) },
 	/* Acer Aspire One A150 (maximlevitsky@...il.com) */
-	{ ATH_SDEVICE(PCI_VENDOR_ID_FOXCONN, 0xe008), ATH_LED(3, 0) },
+	{ ATH_SDEVICE(PCI_VENDOR_ID_FOXCONN, 0xe008),
+			.driver_data = ATH_LED(3, 0) },
 	/* Acer Ferrari 5000 (russ.dill@...il.com) */
-	{ ATH_SDEVICE(PCI_VENDOR_ID_AMBIT, 0x0422), ATH_LED(1, 1) },
+	{ ATH_SDEVICE(PCI_VENDOR_ID_AMBIT, 0x0422),
+			.driver_data = ATH_LED(1, 1) },
 	/* E-machines E510 (tuliom@...il.com) */
-	{ ATH_SDEVICE(PCI_VENDOR_ID_AMBIT, 0x0428), ATH_LED(3, 0) },
+	{ ATH_SDEVICE(PCI_VENDOR_ID_AMBIT, 0x0428),
+			.driver_data = ATH_LED(3, 0) },
 	/* Acer Extensa 5620z (nekoreeve@...il.com) */
-	{ ATH_SDEVICE(PCI_VENDOR_ID_QMI, 0x0105), ATH_LED(3, 0) },
+	{ ATH_SDEVICE(PCI_VENDOR_ID_QMI, 0x0105),
+			.driver_data = ATH_LED(3, 0) },
 	/* Fukato Datacask Jupiter 1014a (mrb74@....at) */
-	{ ATH_SDEVICE(PCI_VENDOR_ID_AZWAVE, 0x1026), ATH_LED(3, 0) },
+	{ ATH_SDEVICE(PCI_VENDOR_ID_AZWAVE, 0x1026),
+			.driver_data = ATH_LED(3, 0) },
 	/* IBM ThinkPad AR5BXB6 (legovini@...ro.fisica.unipd.it) */
-	{ ATH_SDEVICE(PCI_VENDOR_ID_IBM, 0x058a), ATH_LED(1, 0) },
+	{ ATH_SDEVICE(PCI_VENDOR_ID_IBM, 0x058a),
+			.driver_data = ATH_LED(1, 0) },
 	/* IBM-specific AR5212 (all others) */
-	{ PCI_VDEVICE(ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5212_IBM), ATH_LED(0, 0) },
+	{ PCI_VDEVICE(ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5212_IBM),
+			.driver_data = ATH_LED(0, 0) },
 	{ }
 };
 
-- 
1.6.3

--
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