staging: rtl8192u: Fix warnings in ieee80211_crypt.c
v3 cover staging: rtl8192u: Fix warnings in ieee80211_crypt.c
[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: Clean-up comment line style
staging: rtl8192u: Replace asm header files with linux ones.
staging: rtl8192u: Fix quoted string split across lines.
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
Signature · 1 line
1.9.1
PATCH v3 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 v2:
- Correct the commit message to be clearer.
---
Changes in v3:
- Change pr_dbg to pr_debug as it gives the following warning:
implicit declaration of function ‘pr_dbg’ and update subject 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 v3 2/4 staging: rtl8192u: Clean-up comment line style
In reply to Navya Sri NizamkariConvert style of comment from C99 to C89 to fix the following checkpatch.pl error:
ERROR: "Do not use C99 // comments"
---
Changes in v3:
-None in this file of the patchset
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c +1 -1
@@ -11,7 +11,7 @@* */ -//#include <linux/config.h> +/* #include <linux/config.h> */ #include <linux/module.h> #include <linux/init.h> #include <linux/slab.h>
Signature · 1 line
1.9.1
PATCH v3 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 v3:
-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
@@ -15,8 +15,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 v3 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 v3:
-None in this patch.
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c +6 -6
@@ -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)) { -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); }
@@ -146,8 +146,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); }
@@ -232,8 +232,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
Re: [Outreachy kernel] [PATCH v3 2/4] staging: rtl8192u: Clean-up comment line style
In reply to Navya Sri NizamkariQuoted 19 lines · Navya Sri Nizamkari
Convert style of comment from C99 to C89 to fix the following checkpatch.pl error:
ERROR: "Do not use C99 // comments"
Signed-off-by Navya Sri Nizamkari <[email protected]>---
Changes in v3:
-None in this file of the patchsetdrivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c +0
-0
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c line 17
Quoted 8 lines
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c +1
-1@@ -11,7 +11,7 @@* */ -//#include <linux/config.h> +/* #include <linux/config.h> */ #include <linux/module.h> #include <linux/init.h> #include <linux/slab.h>
This is dead code, rather than changing the comment style, you should remove the line completely.
Cheers,
Jes
Re: [Outreachy kernel] [PATCH v3 3/4] staging: rtl8192u: Replace asm header files with linux ones.
In reply to Navya Sri NizamkariQuoted 7 lines · Navya Sri Nizamkari
As 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>
Quoted 7 lines
Signed-off-by Navya Sri Nizamkari <[email protected]>---
Changes in v3:-None.drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
This part looks good.
Jes
Quoted 16 lines
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c +2
-2@@ -15,8 +15,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"
Re: [Outreachy kernel] [PATCH v3 4/4] staging: rtl8192u: Fix quoted string split across lines.
In reply to Navya Sri NizamkariQuoted 17 lines · Navya Sri Nizamkari
This patch fixes the checkpatch.pl warning:
WARNING: quoted string split across lines
Signed-off-by Navya Sri Nizamkari <[email protected]>---
Changes in v3:
-None in this patch.drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 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)) { -netdev_dbg (ieee->dev,"entries remaining in delayed crypt " -"deletion list\n" ); +netdev_dbg (ieee->dev, +"entries remaining in delayed crypt deletion list\n" );
The principle of your changes is good, but you need to get the indentation right. If you put an argument to a function on the next line, it needs to line up with the first argument of the function.
netdev_dbg(foo, very_long_argument_that_should_not_break_lines);
This is the same in all the cases below as well.
Jes
Quoted 26 lines
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c +4
-4ieee->crypt_deinit_timer.expires = jiffies +HZ ;add_timer (&ieee->crypt_deinit_timer); }@@ -146,8 +146,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); }@@ -232,8 +232,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); }
Re: [Outreachy kernel] [PATCH v3 2/4] staging: rtl8192u: Clean-up comment line style
In reply to Jes SorensenQuoted 34 lines · jes.sorensen
Quoted 6 lines · Navya Sri Nizamkari
Convert style of comment from C99 to C89 to fix the following checkpatch.pl error:
ERROR: "Do not use C99 // comments"
Signed-off-by Navya Sri Nizamkari <[email protected] <javascript:>>Review
Quoted 8 lines
---
Changes in v3:
-None in this file of the patchsetdrivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.cdrivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c line 17
Quoted 13 lines
index eb89321..bcb2479 100644
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c +1
-1@@ -11,7 +11,7 @@* */ -//#include <linux/config.h> +/* #include <linux/config.h> */ #include <linux/module.h> #include <linux/init.h> #include <linux/slab.h> This is dead code, rather than changing the comment style, you should remove the line completely.
Quoted 4 lines
Cheers,
Jes
Hi,
I sent in the older version of this patch by mistake. I sent a newer version of the patchset.
Navya