[OPW,kernel] Staging: wlan-ng: fix printk(KERN_DEBUG
diff mbox

Message ID 1380970151-5539-1-git-send-email-ebru.akagunduz@gmail.com
State Changes Requested
Headers show

Commit Message

Ebru Akagündüz Oct. 5, 2013, 10:49 a.m. UTC
Fix checkpatch.pl issues with prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then pr_debug(...  to printk(KERN_DEBUG in p80211wep.c
---
 drivers/staging/wlan-ng/p80211wep.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Xenia Ragiadakou Oct. 5, 2013, 12:45 p.m. UTC | #1
Hi Ebru,

i added some comments below.

On 10/05/2013 01:49 PM, Ebru Akagunduz wrote:
> Fix checkpatch.pl issues with prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then pr_debug(...  to printk(KERN_DEBUG in p80211wep.c
> ---
>   drivers/staging/wlan-ng/p80211wep.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/wlan-ng/p80211wep.c b/drivers/staging/wlan-ng/p80211wep.c
> index 77e50a4..174e702 100644
> --- a/drivers/staging/wlan-ng/p80211wep.c
> +++ b/drivers/staging/wlan-ng/p80211wep.c
> @@ -134,7 +134,7 @@ int wep_change_key(wlandevice_t *wlandev, int keynum, u8 *key, int keylen)
>   		return -1;
>   
>   #ifdef WEP_DEBUG
> -	printk(KERN_DEBUG "WEP key %d len %d = %*phC\n", keynum, keylen,
> +	pr_debug(KERN_DEBUG "WEP key %d len %d = %*phC\n", keynum, keylen,
>   			  8, key);
>   #endif

Here, you do not need to state the log level (KERNEL_DEBUG) in 
pr_debug() because pr_debug() will call by default printk(KERN_DEBUG 
fmt, ...) if it is enabled. That means that you need to write only 
pr_debug("WEP key %d len %d = %*phC\n", keynum, keylen, 8, key)

>   
> @@ -182,7 +182,7 @@ int wep_decrypt(wlandevice_t *wlandev, u8 *buf, u32 len, int key_override,
>   	keylen += 3;		/* add in IV bytes */
>   
>   #ifdef WEP_DEBUG
> -	printk(KERN_DEBUG "D %d: %*ph (%d %d) %*phC\n", len, 3, key,
> +	pr_debug(KERN_DEBUG "D %d: %*ph (%d %d) %*phC\n", len, 3, key,
>   			  keyidx, keylen, 5, key + 3);
>   #endif
>   
> @@ -259,7 +259,7 @@ int wep_encrypt(wlandevice_t *wlandev, u8 *buf, u8 *dst, u32 len, int keynum,
>   	keylen += 3;		/* add in IV bytes */
>   
>   #ifdef WEP_DEBUG
> -	printk(KERN_DEBUG "E %d (%d/%d %d) %*ph %*phC\n", len,
> +	pr_debug(KERN_DEBUG "E %d (%d/%d %d) %*ph %*phC\n", len,
>   			  iv[3], keynum, keylen, 3, key, 5, key + 3);
>   #endif
>   

The same stands for here too, you need to remove KERN_DEBUG from pr_debug().

ksenia
Ebru Akagündüz Oct. 5, 2013, 3:12 p.m. UTC | #2
Thank you, I will resend this patch.

Patch
diff mbox

diff --git a/drivers/staging/wlan-ng/p80211wep.c b/drivers/staging/wlan-ng/p80211wep.c
index 77e50a4..174e702 100644
--- a/drivers/staging/wlan-ng/p80211wep.c
+++ b/drivers/staging/wlan-ng/p80211wep.c
@@ -134,7 +134,7 @@  int wep_change_key(wlandevice_t *wlandev, int keynum, u8 *key, int keylen)
 		return -1;
 
 #ifdef WEP_DEBUG
-	printk(KERN_DEBUG "WEP key %d len %d = %*phC\n", keynum, keylen,
+	pr_debug(KERN_DEBUG "WEP key %d len %d = %*phC\n", keynum, keylen,
 			  8, key);
 #endif
 
@@ -182,7 +182,7 @@  int wep_decrypt(wlandevice_t *wlandev, u8 *buf, u32 len, int key_override,
 	keylen += 3;		/* add in IV bytes */
 
 #ifdef WEP_DEBUG
-	printk(KERN_DEBUG "D %d: %*ph (%d %d) %*phC\n", len, 3, key,
+	pr_debug(KERN_DEBUG "D %d: %*ph (%d %d) %*phC\n", len, 3, key,
 			  keyidx, keylen, 5, key + 3);
 #endif
 
@@ -259,7 +259,7 @@  int wep_encrypt(wlandevice_t *wlandev, u8 *buf, u8 *dst, u32 len, int keynum,
 	keylen += 3;		/* add in IV bytes */
 
 #ifdef WEP_DEBUG
-	printk(KERN_DEBUG "E %d (%d/%d %d) %*ph %*phC\n", len,
+	pr_debug(KERN_DEBUG "E %d (%d/%d %d) %*ph %*phC\n", len,
 			  iv[3], keynum, keylen, 3, key, 5, key + 3);
 #endif