Search Linux Wireless

[PATCH 19/24] rt2x00: macro's shouldn't use hidden arguments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



RT2X00DEBUGFS_CREATE_ENTRY used the intf variable
while this wasn't passed as argument. That can be
considered as a bad coding style.

Signed-off-by: Ivo van Doorn <IvDoorn@xxxxxxxxx>
---
 drivers/net/wireless/rt2x00/rt2x00debug.c |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2x00debug.c b/drivers/net/wireless/rt2x00/rt2x00debug.c
index eaa4c54..4d2aaec 100644
--- a/drivers/net/wireless/rt2x00/rt2x00debug.c
+++ b/drivers/net/wireless/rt2x00/rt2x00debug.c
@@ -270,29 +270,29 @@ void rt2x00debug_register(struct rt2x00_dev *rt2x00dev)
 	if (IS_ERR(intf->chipset_entry))
 		goto exit;
 
-#define RT2X00DEBUGFS_CREATE_ENTRY(__name)			\
+#define RT2X00DEBUGFS_CREATE_ENTRY(__intf, __name)		\
 ({								\
-	intf->__name##_off_entry =				\
+	(__intf)->__name##_off_entry =				\
 	    debugfs_create_u32(__stringify(__name) "_offset",	\
 			       S_IRUGO | S_IWUSR,		\
-			       intf->driver_folder,		\
-			       &intf->offset_##__name);		\
-	if (IS_ERR(intf->__name##_off_entry))			\
+			       (__intf)->driver_folder,		\
+			       &(__intf)->offset_##__name);	\
+	if (IS_ERR((__intf)->__name##_off_entry))		\
 		goto exit;					\
 								\
-	intf->__name##_val_entry =				\
+	(__intf)->__name##_val_entry =				\
 	    debugfs_create_file(__stringify(__name) "_value",	\
 				S_IRUGO | S_IWUSR,		\
-				intf->driver_folder,		\
-				intf, &rt2x00debug_fop_##__name);\
-	if (IS_ERR(intf->__name##_val_entry))			\
+				(__intf)->driver_folder,	\
+				(__intf), &rt2x00debug_fop_##__name);\
+	if (IS_ERR((__intf)->__name##_val_entry))		\
 		goto exit;					\
 })
 
-	RT2X00DEBUGFS_CREATE_ENTRY(csr);
-	RT2X00DEBUGFS_CREATE_ENTRY(eeprom);
-	RT2X00DEBUGFS_CREATE_ENTRY(bbp);
-	RT2X00DEBUGFS_CREATE_ENTRY(rf);
+	RT2X00DEBUGFS_CREATE_ENTRY(intf, csr);
+	RT2X00DEBUGFS_CREATE_ENTRY(intf, eeprom);
+	RT2X00DEBUGFS_CREATE_ENTRY(intf, bbp);
+	RT2X00DEBUGFS_CREATE_ENTRY(intf, rf);
 
 #undef RT2X00DEBUGFS_CREATE_ENTRY
 
-- 
1.5.3
-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux