Skip to contentSkip to conversation

staging:rtl8192u: Coding Style changes

PATCH In review John Whitmore 2 participants 14 messages Oct 7, 2018 – Oct 9, 2018 Staging

lore
Share & tools
lore
#0 lore raw

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
#1 lore raw

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
index 90a097f2cd4e..5f8229f2c757 100644
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*******************************************************************************
  *
  *  Copyright(c) 2004 Intel Corporation. All rights reserved.
Signature · 1 line
2.19.0
#2 lore raw

PATCH 2/11 staging:rtl8192u: Removed commented out include - Style

In reply to John Whitmore

Remove 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
index 5f8229f2c757..bd64d126ba2b 100644
@@ -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
maintainer
#3 lore raw

Re: [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...

#4 lore raw

PATCH 3/11 staging:rtl8192u: Clear error with line ending ( - Style

In reply to John Whitmore

Rewrite 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
index bd64d126ba2b..20348a1f2d32 100644
@@ -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
#5 lore raw

PATCH 4/11 staging:rtl8192u: Remove extra blank lines - Style

In reply to John Whitmore

Remove 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
index 20348a1f2d32..c52eac0bf6f6 100644
@@ -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
#6 lore raw

PATCH 5/11 staging:rtl8192u: Add spaces around + operator - Style

In reply to John Whitmore

Add 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
index c52eac0bf6f6..0fe65dd8c407 100644
@@ -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
#7 lore raw

PATCH 6/11 staging:rtl8192u: Rewrite test for null - Style

In reply to 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.

---
 drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +1 -1
index 0fe65dd8c407..9bbacec52e1f 100644
@@ -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
maintainer
#8 lore raw

Re: [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.

---
 drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

This patch did not apply :(

#9 lore raw

PATCH 7/11 staging:rtl8192u: Correct code indentation - Style

In reply to John Whitmore

Rewrite 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
index 9bbacec52e1f..c31db21f7e63 100644
@@ -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
#10 lore raw

PATCH 8/11 staging:rtl8192u: Add missing blank lines - Style

In reply to John Whitmore

Add 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
index c31db21f7e63..f134cd5a9829 100644
@@ -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
#11 lore raw

PATCH 9/11 staging:rtl8192u: Remove unnecessary line continuation - Style

In reply to John Whitmore

Remove 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
index f134cd5a9829..1b0f45f1bb84 100644
@@ -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
#12 lore raw

PATCH 10/11 staging:rtl8192u: Correct code alignment - Style

In reply to John Whitmore

Correct 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
index 1b0f45f1bb84..5dc780119eff 100644
@@ -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
#13 lore raw

PATCH 11/11 staging:rtl8192u: Correct comparison with NULL - Style

In reply to John Whitmore

Correct 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
index 5dc780119eff..57127d2a462a 100644
@@ -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