staging:rtl8192u: Coding Style changes
cover staging:rtl8192u: Coding Style changes
Just a number of simple coding style changes in the file ieee80211_module.c
John Whitmore (11):
staging:rtl8192u: Add missing SPDX-License-Identifier - Style staging:rtl8192u: Removed commented out include - Style staging:rtl8192u: Clear error with line ending ( - Style staging:rtl8192u: Remove extra blank lines - Style staging:rtl8192u: Add spaces around + operator - Style staging:rtl8192u: Rewrite test for null - Style staging:rtl8192u: Correct code indentation - Style staging:rtl8192u: Add missing blank lines - Style staging:rtl8192u: Remove unnecessary line continuation - Style staging:rtl8192u: Correct code alignment - Style staging:rtl8192u: Correct comparison with NULL - Style
.../rtl8192u/ieee80211/ieee80211_module.c | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-)
Signature · 1 line
2.19.0
PATCH 1/11 staging:rtl8192u: Add missing SPDX-License-Identifier - Style
Add the missing SPDX-License-Identifier tag to file to clear the checkpatch issue.
This is a coding style change which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 1 + 1 file changed, 1 insertion(+)
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +1 -0
@@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /******************************************************************************* * * Copyright(c) 2004 Intel Corporation. All rights reserved.
Signature · 1 line
2.19.0
PATCH 2/11 staging:rtl8192u: Removed commented out include - Style
In reply to John WhitmoreRemove commented out #include directive.
Additionally shorted a block comment to clear the checkpatch issue with line length.
These are coding style changes which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +1 -2
@@ -29,10 +29,9 @@* James P. Ketrenos <[email protected]> * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 * -*******************************************************************************/ +******************************************************************************/ #include <linux/compiler.h> -/* #include <linux/config.h> */ #include <linux/errno.h> #include <linux/if_arp.h> #include <linux/in6.h>
Signature · 1 line
2.19.0
Greg KH
maintainerRe: [PATCH 02/11] staging:rtl8192u: Removed commented out include - Style
Quoted 4 lines · John Whitmore
Remove commented out #include directive.
Additionally shorted a block comment to clear the checkpatch issue with line length.
You really should only do one type of thing per patch, but I'll let this one go...
PATCH 3/11 staging:rtl8192u: Clear error with line ending ( - Style
In reply to John WhitmoreRewrite function call to clear the checkpatch issue with lines ending with a '(' character.
This is a coding style change which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +3 -3
@@ -64,9 +64,9 @@ static inline int ieee80211_networks_allocate(struct ieee80211_device *ieee)if (ieee->networks)return 0 ; - ieee->networks =kcalloc ( -MAX_NETWORK_COUNT ,sizeof (struct ieee80211_network ), -GFP_KERNEL ); + ieee->networks =kcalloc (MAX_NETWORK_COUNT , +sizeof (struct ieee80211_network ), +GFP_KERNEL );if (!ieee->networks) {printk (KERN_WARNING "%s: Out of memory allocating beacons\n" , ieee->dev->name);
Signature · 1 line
2.19.0
PATCH 4/11 staging:rtl8192u: Remove extra blank lines - Style
In reply to John WhitmoreRemove the extra blank lines to clear checkpatch issue.
This is a simple coding style change which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 3 --- 1 file changed, 3 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +0 -3
@@ -94,7 +94,6 @@ static inline void ieee80211_networks_initialize(struct ieee80211_device *ieee)list_add_tail (&ieee->networks[i].list, &ieee->network_free_list); } -struct net_device *alloc_ieee80211 (int sizeof_priv) {struct ieee80211_device *ieee;
@@ -121,7 +120,6 @@ struct net_device *alloc_ieee80211(int sizeof_priv) }ieee80211_networks_initialize (ieee); -/* Default fragmentation threshold is maximum payload size */ ieee->fts =DEFAULT_FTS ; ieee->scan_age =DEFAULT_MAX_SCAN_AGE ;
@@ -186,7 +184,6 @@ struct net_device *alloc_ieee80211(int sizeof_priv)return NULL ; } -void free_ieee80211 (struct net_device *dev) {struct ieee80211_device *ieee =netdev_priv (dev);
Signature · 1 line
2.19.0
PATCH 5/11 staging:rtl8192u: Add spaces around + operator - Style
In reply to John WhitmoreAdd spaces around '+' operator to clear the checkpatch issue.
This is a coding style change which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +1 -1
@@ -109,7 +109,7 @@ struct net_device *alloc_ieee80211(int sizeof_priv) } ieee =netdev_priv (dev); -memset (ieee,0 ,sizeof (struct ieee80211_device )+sizeof_priv); +memset (ieee,0 ,sizeof (struct ieee80211_device ) + sizeof_priv); ieee->dev = dev; err =ieee80211_networks_allocate (ieee);
Signature · 1 line
2.19.0
PATCH 6/11 staging:rtl8192u: Rewrite test for null - Style
In reply to John WhitmoreRewrite a test for NULL to comply with the coding style and clear the checkpatch issue.
This is a coding style change which should not impact runtime code execution.
--- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +1 -1
@@ -155,7 +155,7 @@ struct net_device *alloc_ieee80211(int sizeof_priv)ieee80211_softmac_init (ieee); ieee->pHTInfo =kzalloc (sizeof (RT_HIGH_THROUGHPUT ),GFP_KERNEL ); -if (ieee->pHTInfo ==NULL ) { +if (!ieee->pHTInfo) {IEEE80211_DEBUG (IEEE80211_DL_ERR ,"can't alloc memory for HTInfo\n" ); goto failed; }
Signature · 1 line
2.19.0
Greg KH
maintainerRe: [PATCH 06/11] staging:rtl8192u: Rewrite test for null - Style
Quoted 10 lines · John Whitmore
Rewrite a test for NULL to comply with the coding style and clear the checkpatch issue.
This is a coding style change which should not impact runtime code execution.
Signed-off-by John Whitmore <[email protected]>--- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
This patch did not apply :(
PATCH 7/11 staging:rtl8192u: Correct code indentation - Style
In reply to John WhitmoreRewrite code block to correct the indentation of code. This clears the resulting checkpatch issue.
This is a coding style change which should not impact runtime code execution.
--- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +3 -3
@@ -167,9 +167,9 @@ struct net_device *alloc_ieee80211(int sizeof_priv)INIT_LIST_HEAD (&ieee->ibss_mac_hash[i]);for (i =0 ; i <17 ; i++) { - ieee->last_rxseq_num[i] =-1 ; - ieee->last_rxfrag_num[i] =-1 ; - ieee->last_packet_time[i] =0 ; + ieee->last_rxseq_num[i] =-1 ; + ieee->last_rxfrag_num[i] =-1 ; + ieee->last_packet_time[i] =0 ; }/* These function were added to load crypte module autoly */
Signature · 1 line
2.19.0
PATCH 8/11 staging:rtl8192u: Add missing blank lines - Style
In reply to John WhitmoreAdd missing blank lines after declarations. This clears the resulting checkpatch issue.
This is a simple coding style change which should not impact runtime code execution.
--- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +2 -0
@@ -199,6 +199,7 @@ void free_ieee80211(struct net_device *dev)for (i =0 ; i <WEP_KEYS ; i++) {struct ieee80211_crypt_data *crypt = ieee->crypt[i]; +if (crypt) {if (crypt->ops) crypt->ops->deinit (crypt->priv);
@@ -248,6 +249,7 @@ static ssize_t write_debug_level(struct file *file, const char __user *buffer, {unsigned long val;int err =kstrtoul_from_user (buffer, count,0 , &val); +if (err)return err; ieee80211_debug_level = val;
Signature · 1 line
2.19.0
PATCH 9/11 staging:rtl8192u: Remove unnecessary line continuation - Style
In reply to John WhitmoreRemove the unnecessary line continuation character to clear checkpatch issue.
This is a simple coding style change which should not impact runtime code execution.
--- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +1 -2
@@ -215,8 +215,7 @@ void free_ieee80211(struct net_device *dev)#ifdef CONFIG_IEEE80211_DEBUG u32 ieee80211_debug_level; -static int debug = \ -// IEEE80211_DL_INFO | +static int debug =// IEEE80211_DL_INFO | // IEEE80211_DL_WX | // IEEE80211_DL_SCAN | // IEEE80211_DL_STATE |
Signature · 1 line
2.19.0
PATCH 10/11 staging:rtl8192u: Correct code alignment - Style
In reply to John WhitmoreCorrect the alignment of a function, this clears checkpatch issue.
This is a simple coding style change which should not impact runtime code execution.
--- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +1 -1
@@ -244,7 +244,7 @@ static int show_debug_level(struct seq_file *m, void *v) }static ssize_t write_debug_level (struct file *file,const char __user *buffer, -size_t count,loff_t *ppos) +size_t count,loff_t *ppos) {unsigned long val;int err =kstrtoul_from_user (buffer, count,0 , &val);
Signature · 1 line
2.19.0
PATCH 11/11 staging:rtl8192u: Correct comparison with NULL - Style
In reply to John WhitmoreCorrect code to remote comparison with NULL, this clears the resulting checkpatch issue.
This is a coding style change which should not impact runtime code execution.
--- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +1 -1
@@ -275,7 +275,7 @@ int __init ieee80211_debug_init(void) ieee80211_debug_level = debug; ieee80211_proc =proc_mkdir (DRV_NAME , init_net.proc_net); -if (ieee80211_proc ==NULL ) { +if (!ieee80211_proc) {IEEE80211_ERROR ("Unable to create " DRV_NAME " proc directory\n" );return -EIO ;
Signature · 1 line
2.19.0