staging: rtl8192u: Fix warnings in ieee80211_crypt.c
v4 cover staging: rtl8192u: Fix warnings in ieee80211_crypt.c
[changes in v4]
In v4 version, code indentation is changed to look better.
[changes in v3]
In v3 version, the printk functions which are changed to pr_dbg are changed to pr_debug as pr_dbg gives a 'implicit declaration of function' warning when you build.
[changes in v2]
In v2 version of this patchset I correct the commit message of [PATCH 1/4] to be clearer and remove a comment from [PATCH 2/4] whose style was changed in version v1.
[original cover letter]
This patchset removes an unnecessary comment and clears checkpatch.pl warnings in ieee80211_crypt.c such as:
convert printk to a preferable function like netdev_dbg or pr_dbg, replace asm header files with
linux ones, fix the quoted string split across a line.
Navya Sri Nizamkari (4):
staging: rtl8192u: Convert from printk into netdev_dbg or pr_dbg
staging: rtl8192u: Remove unnecessary comment.
staging: rtl8192u: Replace asm header files with linux ones.
staging: rtl8192u: Fix quoted string split across lines.
.../staging/rtl8192u/ieee80211/ieee80211_crypt.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-)
Signature · 1 line
1.9.1
PATCH v4 1/4 staging: rtl8192u: Convert from printk into netdev_dbg or pr_debug
As this is a network driver file, convert printk(KERN_DEBUG.. ) to netdev_dbg if the calling function has arguments to support it else to pr_debug , to fix the checkpatch.pl warning:
WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then pr_debug(... to printk(KERN_DEBUG ...
---
Changes in v4:
- Changed code indentation.
Changes in v3:
- Change pr_dbg to pr_debug as it gives the following warning:
implicit declaration of function ‘pr_dbg’and change subject name to reflect the change.
Changes in v2:
- Correct the commit message to be clearer.
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c +5 -5
@@ -66,8 +66,8 @@ void ieee80211_crypt_deinit_handler(unsigned long data)spin_lock_irqsave (&ieee->lock, flags);ieee80211_crypt_deinit_entries (ieee,0 );if (!list_empty (&ieee->crypt_deinit_list)) { -printk (KERN_DEBUG "%s: entries remaining in delayed crypt " -"deletion list\n" , ieee->dev->name); +netdev_dbg (ieee->dev,"entries remaining in delayed crypt " +"deletion list\n" ); ieee->crypt_deinit_timer.expires = jiffies +HZ ;add_timer (&ieee->crypt_deinit_timer); }
@@ -118,7 +118,7 @@ int ieee80211_register_crypto_ops(struct ieee80211_crypto_ops *ops)list_add (&alg->list, &hcrypt->algs);spin_unlock_irqrestore (&hcrypt->lock, flags); -printk (KERN_DEBUG "ieee80211_crypt: registered algorithm '%s'\n" , +pr_debug ("ieee80211_crypt: registered algorithm '%s'\n" , ops->name);return 0 ;
@@ -146,7 +146,7 @@ int ieee80211_unregister_crypto_ops(struct ieee80211_crypto_ops *ops)spin_unlock_irqrestore (&hcrypt->lock, flags);if (del_alg) { -printk (KERN_DEBUG "ieee80211_crypt: unregistered algorithm " +pr_debug ("ieee80211_crypt: unregistered algorithm " "'%s'\n" , ops->name);kfree (del_alg); }
@@ -232,7 +232,7 @@ void __exit ieee80211_crypto_deinit(void)struct ieee80211_crypto_alg *alg = (struct ieee80211_crypto_alg *) ptr;list_del (ptr); -printk (KERN_DEBUG "ieee80211_crypt: unregistered algorithm " +pr_debug ("ieee80211_crypt: unregistered algorithm " "'%s' (deinit)\n" , alg->ops->name);kfree (alg); }
Signature · 1 line
1.9.1
PATCH v4 2/4 staging: rtl8192u: Remove unnecessary comment.
In reply to Navya Sri NizamkariThe <linux/config.h> header file is not used anymore, so it is commented out in this file.This patch deletes that unnecessary comment.
---
Changes in v4:
-In v3 I sent the wrong patch, so sending the right one in this.
Changes in v3:
-Sent wrong patch(version v1 of the patch).
Changes in v2:
-Removed an unnecessary commented header.
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c | 1 - 1 file changed, 1 deletion(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c +0 -1
@@ -11,7 +11,6 @@* */ -//#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/slab.h>
Signature · 1 line
1.9.1
PATCH v4 3/4 staging: rtl8192u: Replace asm header files with linux ones.
In reply to Navya Sri NizamkariAs asm header files are included in linux header files, this patch uses <linux/string.h> instead of <asm/string.h> and <linux/errno.h> instead of <asm/errno.h> to fix checkpatch.pl errors:
ERROR: Use #include <linux/string.h> instead of <asm/string.h>
ERROR: Use #include <linux/errno.h> instead of <asm/errno.h>
---
Changes in v4:
-None.
Changes in v3:
-None.
Changes in v2:
-None.
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c +2 -2
@@ -14,8 +14,8 @@#include <linux/module.h> #include <linux/init.h> #include <linux/slab.h> -#include <asm/string.h> -#include <asm/errno.h> +#include <linux/string.h> +#include <linux/errno.h> #include "ieee80211.h"
Signature · 1 line
1.9.1
PATCH v4 4/4 staging: rtl8192u: Fix quoted string split across lines.
In reply to Navya Sri NizamkariThis patch fixes the checkpatch.pl warning:
WARNING: quoted string split across lines
---
Changes in v4:
-Indented arguments to be lined up in same column.
Changes in v3:
-None.
Changes in v2:
-None.
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c +7 -7
@@ -65,8 +65,8 @@ void ieee80211_crypt_deinit_handler(unsigned long data)spin_lock_irqsave (&ieee->lock, flags);ieee80211_crypt_deinit_entries (ieee,0 );if (!list_empty (&ieee->crypt_deinit_list)) { -netdev_dbg (ieee->dev,"entries remaining in delayed crypt " -"deletion list\n" ); +netdev_dbg (ieee->dev, +"entries remaining in delayed crypt deletion list\n" ); ieee->crypt_deinit_timer.expires = jiffies +HZ ;add_timer (&ieee->crypt_deinit_timer); }
@@ -118,7 +118,7 @@ int ieee80211_register_crypto_ops(struct ieee80211_crypto_ops *ops)spin_unlock_irqrestore (&hcrypt->lock, flags);pr_debug ("ieee80211_crypt: registered algorithm '%s'\n" , - ops->name); + ops->name);return 0 ; }
@@ -145,8 +145,8 @@ int ieee80211_unregister_crypto_ops(struct ieee80211_crypto_ops *ops)spin_unlock_irqrestore (&hcrypt->lock, flags);if (del_alg) { -pr_debug ("ieee80211_crypt: unregistered algorithm " -"'%s'\n" , ops->name); +pr_debug ("ieee80211_crypt: unregistered algorithm '%s'\n" , + ops->name);kfree (del_alg); }
@@ -231,8 +231,8 @@ void __exit ieee80211_crypto_deinit(void)struct ieee80211_crypto_alg *alg = (struct ieee80211_crypto_alg *) ptr;list_del (ptr); -pr_debug ("ieee80211_crypt: unregistered algorithm " -"'%s' (deinit)\n" , alg->ops->name); +pr_debug ("ieee80211_crypt: unregistered algorithm '%s' (deinit)\n" , + alg->ops->name);kfree (alg); }
Signature · 1 line
1.9.1
Greg KH
maintainerRe: [Outreachy kernel] [PATCH v4 1/4] staging: rtl8192u: Convert from printk into netdev_dbg or pr_debug
In reply to Navya Sri NizamkariQuoted 28 lines · Navya Sri Nizamkari
As this is a network driver file, convert printk(KERN_DEBUG.. ) to
netdev_dbgif the calling function has arguments to support it else topr_debug, to fix the checkpatch.pl warning:WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then pr_debug(... to printk(KERN_DEBUG ...
Signed-off-by Navya Sri Nizamkari <[email protected]>---
Changes in v4:
- Changed code indentation.Changes in v3:
- Changepr_dbgtopr_debugas it gives the following warning:
implicit declaration of function ‘pr_dbg’and change subject name to reflect the change.Changes in v2:
- Correct the commit message to be clearer.drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c +0
-0
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c void ieee80211_crypt_deinit_handler(unsigned long data) · line 70
Quoted 7 lines
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c +2
-2@@ -66,8 +66,8 @@ void ieee80211_crypt_deinit_handler(unsigned long data)spin_lock_irqsave (&ieee->lock, flags);ieee80211_crypt_deinit_entries (ieee,0 );if (!list_empty (&ieee->crypt_deinit_list)) { -printk (KERN_DEBUG "%s: entries remaining in delayed crypt " -"deletion list\n" , ieee->dev->name); +netdev_dbg (ieee->dev,"entries remaining in delayed crypt " +"deletion list\n" );
This patch doesn't apply anymore to my tree :(