Skip to contentSkip to conversation

Staging:rtl8192e Replace function names by using __func__

PATCH In review Janani Sankara Babu 2 participants 2 messages Jun 7, 2018 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging:rtl8192e Replace function names by using __func__

This patch is created to solve the warning shown by checkpatch script Prefer using '"%s...", __func__' to using ', this function's name, in a string

---
 drivers/staging/rtl8192e/rtl819x_BAProc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/rtl8192e/rtl819x_BAProc.c +4 -4
index c466a5e7..3c7ba33 100644
@@ -127,7 +127,7 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst,
 	}
 
 #ifdef VERBOSE_DEBUG
-	print_hex_dump_bytes("rtllib_ADDBA(): ", DUMP_PREFIX_NONE, skb->data,
+	print_hex_dump_bytes("%s(): ", __func__, DUMP_PREFIX_NONE, skb->data,
 			     skb->len);
 #endif
 	return skb;
@@ -178,7 +178,7 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device *ieee, u8 *dst,
 	tag += 2;
 
 #ifdef VERBOSE_DEBUG
-	print_hex_dump_bytes("rtllib_DELBA(): ", DUMP_PREFIX_NONE, skb->data,
+	print_hex_dump_bytes("%s(): ", __func__, DUMP_PREFIX_NONE, skb->data,
 			     skb->len);
 #endif
 	return skb;
@@ -243,7 +243,7 @@ int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb)
 	}
 
 #ifdef VERBOSE_DEBUG
-	print_hex_dump_bytes("rtllib_rx_ADDBAReq(): ", DUMP_PREFIX_NONE,
+	print_hex_dump_bytes("%s(): ", __func__, DUMP_PREFIX_NONE,
 			     skb->data, skb->len);
 #endif
 
@@ -441,7 +441,7 @@ int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb)
 	}
 
 #ifdef VERBOSE_DEBUG
-	print_hex_dump_bytes("rtllib_rx_DELBA(): ", DUMP_PREFIX_NONE, skb->data,
+	print_hex_dump_bytes("%s():", __func__, DUMP_PREFIX_NONE, skb->data,
 			     skb->len);
 #endif
 	delba = (struct rtllib_hdr_3addr *)skb->data;

--
1.9.1

#1 lore raw
Quoted 3 lines · Janani Sankara Babu

This patch is created to solve the warning shown by checkpatch script Prefer using '"%s...", __func__' to using ', this function's name, in a string

[]

drivers/staging/rtl8192e/rtl819x_BAProc.c

Quoted 1 line
drivers/staging/rtl8192e/rtl819x_BAProc.c +0 -0

[]

drivers/staging/rtl8192e/rtl819x_BAProc.c static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst, · line 131

Quoted 7 lines
drivers/staging/rtl8192e/rtl819x_BAProc.c +1 -1
@@ -127,7 +127,7 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst,
 	}
 
 #ifdef VERBOSE_DEBUG
-	print_hex_dump_bytes("rtllib_ADDBA(): ", DUMP_PREFIX_NONE, skb->data,
+	print_hex_dump_bytes("%s(): ", __func__, DUMP_PREFIX_NONE, skb->data,
 			     skb->len);

You didn't compile this with VERBOSE_DEBUG enabled.

You are adding arguments to a function that takes a fixed number of arguments.

checkpatch is mindless.

Please don't mindlessly do what it says, just try to improve the code readability where it's unclear and especially try to find and fix logic defects.