Skip to contentSkip to conversation

staging:rtl8192u: r8192U.h cleanup - Style

PATCH In review John Whitmore 2 participants 25 messages Aug 31, 2018 – Sep 11, 2018 Staging

lore
Share & tools
lore
#0 lore raw

cover staging:rtl8192u: r8192U.h cleanup - Style

Yet another series of patchs to cleanup and clear some checkpatch isses, this time the file r8192U.h. These are all simple changes which are mostly renaming variables. A MACRO has been removed as it's not used in the code, and added SPDX-License-Identifier.

John Whitmore (20):
staging:rtl8192u: Remove write_cam() - Style staging:rtl8192u: Remove read_cam() - Style staging:rtl8192u: Remove unused functions - Style staging:rtl8192u: Add SPDX-License-Identifier - Style staging:rtl8192u: Rename RTL819xU_MODULE_NAME - Style staging:rtl8192u: Rename Rx_Smooth_Factor - Style staging:rtl8192u: Refactor RT_TRACE - Style staging:rtl8192u: Fix space characters - Style staging:rtl8192u: Remove RT_DEBUG_DATA - Style staging:rtl8192u: Rename PHY_Beacon_RSSI_SLID_WIN_MAX - Style staging:rtl8192u: Rename OFDM_Table_Length - Style staging:rtl8192u: Rename CCK_Table_length - Style staging:rtl8192u: Rename PktSize Style staging:rtl8192u: Rename Offset - Style staging:rtl8192u: Rename Reserved... structure members - Style staging:rtl8192u: Rename CmdInit - Style staging:rtl8192u: Rename LastSeg - Style staging:rtl8192u: Rename FirstSeg - Style staging:rtl8192u: Rename LINIP - Style staging:rtl8192u: Rename OWN - Style

 drivers/staging/rtl8192u/r8192U.h      | 82 ++++++++------------------
 drivers/staging/rtl8192u/r8192U_core.c | 67 +++++++--------------
 drivers/staging/rtl8192u/r8192U_dm.c   | 22 +++----
 3 files changed, 58 insertions(+), 113 deletions(-)
Signature · 1 line
2.18.0
#1 lore raw

PATCH 1/20 staging:rtl8192u: Remove write_cam() - Style

Remove the function write_cam() as it is unused.

Simple style change which should not impact runtime code execution.

---
 drivers/staging/rtl8192u/r8192U.h      | 1 -
 drivers/staging/rtl8192u/r8192U_core.c | 7 -------
 2 files changed, 8 deletions(-)
drivers/staging/rtl8192u/r8192U.h +0 -1
index 1b51601df1ee..77324a471de1 100644
@@ -1092,7 +1092,6 @@ short rtl819xU_tx_cmd(struct net_device *dev, struct sk_buff *skb);
 short rtl8192_tx(struct net_device *dev, struct sk_buff *skb);
 
 u32 read_cam(struct net_device *dev, u8 addr);
-void write_cam(struct net_device *dev, u8 addr, u32 data);
 
 int read_nic_byte(struct net_device *dev, int x, u8 *data);
 int read_nic_byte_E(struct net_device *dev, int x, u8 *data);
drivers/staging/rtl8192u/r8192U_core.c +0 -7
index 6b22aaa40ff9..caa618a845df 100644
@@ -237,13 +237,6 @@ static void CamResetAllEntry(struct net_device *dev)
 	write_nic_dword(dev, RWCAM, ulcommand);
 }
 
-
-void write_cam(struct net_device *dev, u8 addr, u32 data)
-{
-	write_nic_dword(dev, WCAMI, data);
-	write_nic_dword(dev, RWCAM, BIT(31) | BIT(16) | (addr & 0xff));
-}
-
 u32 read_cam(struct net_device *dev, u8 addr)
 {
 	u32 data;
Signature · 1 line
2.18.0
#2 lore raw

PATCH 2/20 staging:rtl8192u: Remove read_cam() - Style

In reply to John Whitmore

Remove the function read_cam(), as it is unused in code.

Simple style change which should not impact runtime code execution.

---
 drivers/staging/rtl8192u/r8192U.h      | 2 --
 drivers/staging/rtl8192u/r8192U_core.c | 9 ---------
 2 files changed, 11 deletions(-)
drivers/staging/rtl8192u/r8192U.h +0 -2
index 77324a471de1..70bbd1fadcca 100644
@@ -1091,8 +1091,6 @@ bool init_firmware(struct net_device *dev);
 short rtl819xU_tx_cmd(struct net_device *dev, struct sk_buff *skb);
 short rtl8192_tx(struct net_device *dev, struct sk_buff *skb);
 
-u32 read_cam(struct net_device *dev, u8 addr);
-
 int read_nic_byte(struct net_device *dev, int x, u8 *data);
 int read_nic_byte_E(struct net_device *dev, int x, u8 *data);
 int read_nic_dword(struct net_device *dev, int x, u32 *data);
drivers/staging/rtl8192u/r8192U_core.c +0 -9
index caa618a845df..12783b88eb58 100644
@@ -237,15 +237,6 @@ static void CamResetAllEntry(struct net_device *dev)
 	write_nic_dword(dev, RWCAM, ulcommand);
 }
 
-u32 read_cam(struct net_device *dev, u8 addr)
-{
-	u32 data;
-
-	write_nic_dword(dev, RWCAM, 0x80000000 | (addr & 0xff));
-	read_nic_dword(dev, 0xa8, &data);
-	return data;
-}
-
 int write_nic_byte_E(struct net_device *dev, int indx, u8 data)
 {
 	int status;
Signature · 1 line
2.18.0
#3 lore raw

PATCH 3/20 staging:rtl8192u: Remove unused functions - Style

In reply to John Whitmore

Remove unused function declarations. This is a coding style change which should have no impact on runtime code execution.

---
 drivers/staging/rtl8192u/r8192U.h      | 10 ----------
 drivers/staging/rtl8192u/r8192U_core.c |  7 -------
 2 files changed, 17 deletions(-)
drivers/staging/rtl8192u/r8192U.h +0 -10
index 70bbd1fadcca..b3e6ce2acedb 100644
@@ -1103,22 +1103,12 @@ void force_pci_posting(struct net_device *dev);
 
 void rtl8192_rtx_disable(struct net_device *dev);
 void rtl8192_rx_enable(struct net_device *dev);
-void rtl8192_tx_enable(struct net_device *dev);
 
-void rtl8192_disassociate(struct net_device *dev);
-void rtl8185_set_rf_pins_enable(struct net_device *dev, u32 a);
-
-void rtl8192_set_anaparam(struct net_device *dev, u32 a);
-void rtl8185_set_anaparam2(struct net_device *dev, u32 a);
 void rtl8192_update_msr(struct net_device *dev);
 int rtl8192_down(struct net_device *dev);
 int rtl8192_up(struct net_device *dev);
 void rtl8192_commit(struct net_device *dev);
 void rtl8192_set_chan(struct net_device *dev, short ch);
-void write_phy(struct net_device *dev, u8 adr, u8 data);
-void write_phy_cck(struct net_device *dev, u8 adr, u32 data);
-void write_phy_ofdm(struct net_device *dev, u8 adr, u32 data);
-void rtl8185_tx_antenna(struct net_device *dev, u8 ant);
 void rtl8192_set_rxconf(struct net_device *dev);
 void rtl819xusb_beacon_tx(struct net_device *dev, u16 tx_rate);
 
drivers/staging/rtl8192u/r8192U_core.c +0 -7
index 12783b88eb58..98bb40c50f40 100644
@@ -830,13 +830,6 @@ void rtl8192_rx_enable(struct net_device *dev)
 	rtl8192_rx_initiate(dev);
 }
 
-
-void rtl8192_tx_enable(struct net_device *dev)
-{
-}
-
-
-
 void rtl8192_rtx_disable(struct net_device *dev)
 {
 	u8 cmd;
Signature · 1 line
2.18.0
#4 lore raw

PATCH 4/20 staging:rtl8192u: Add SPDX-License-Identifier - Style

In reply to John Whitmore

Add SPDX-License-Identifier tag to the start of header file. This is a coding style change which should have no impact on runtime code execution.

---
 drivers/staging/rtl8192u/r8192U.h | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/rtl8192u/r8192U.h +1 -0
index b3e6ce2acedb..4dcfcb4d3911 100644
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * This is part of rtl8187 OpenSource driver.
  * Copyright (C) Andrea Merello 2004-2005  <[email protected]>
Signature · 1 line
2.18.0
#5 lore raw

PATCH 5/20 staging:rtl8192u: Rename RTL819xU_MODULE_NAME - Style

In reply to John Whitmore

Rename the MACRO RTL819xU_MODULE_NAME to RTL819XU_MODULE_NAME, this clears the checkpatch issue with CamelCase naming.

This is a coding style change which should have no impact on runtime code execution.

---
 drivers/staging/rtl8192u/r8192U.h      | 2 +-
 drivers/staging/rtl8192u/r8192U_core.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8192u/r8192U.h +1 -1
index 4dcfcb4d3911..81a7072a6285 100644
@@ -40,7 +40,7 @@
 #include "ieee80211/ieee80211.h"
 
 #define RTL8192U
-#define RTL819xU_MODULE_NAME "rtl819xU"
+#define RTL819XU_MODULE_NAME "rtl819xU"
 /* HW security */
 #define MAX_KEY_LEN     61
 #define KEY_BUF_SIZE    5
drivers/staging/rtl8192u/r8192U_core.c +2 -2
index 98bb40c50f40..b3d32ea29fee 100644
@@ -128,7 +128,7 @@ static void rtl8192_usb_disconnect(struct usb_interface *intf);
 
 
 static struct usb_driver rtl8192_usb_driver = {
-	.name		= RTL819xU_MODULE_NAME,		  /* Driver name   */
+	.name		= RTL819XU_MODULE_NAME,		  /* Driver name   */
 	.id_table	= rtl8192_usb_id_tbl,		  /* PCI_ID table  */
 	.probe		= rtl8192_usb_probe,		  /* probe fn      */
 	.disconnect	= rtl8192_usb_disconnect,	  /* remove fn     */
@@ -627,7 +627,7 @@ static int __maybe_unused proc_get_stats_rx(struct seq_file *m, void *v)
 static void rtl8192_proc_module_init(void)
 {
 	RT_TRACE(COMP_INIT, "Initializing proc filesystem");
-	rtl8192_proc = proc_mkdir(RTL819xU_MODULE_NAME, init_net.proc_net);
+	rtl8192_proc = proc_mkdir(RTL819XU_MODULE_NAME, init_net.proc_net);
 }
 
 static void rtl8192_proc_init_one(struct net_device *dev)
Signature · 1 line
2.18.0
#6 lore raw

PATCH 6/20 staging:rtl8192u: Rename Rx_Smooth_Factor - Style

In reply to John Whitmore

Rename the MACRO Rx_Smooth_Factor to RX_SMOOTH_FACTOR, this clears the checkpatch issue with CamelCase naming.

This is a coding style change which should have no impact on runtime code execution.

---
 drivers/staging/rtl8192u/r8192U.h      |  2 +-
 drivers/staging/rtl8192u/r8192U_core.c | 20 ++++++++++----------
 2 files changed, 11 insertions(+), 11 deletions(-)
drivers/staging/rtl8192u/r8192U.h +1 -1
index 81a7072a6285..b5ad69af8dac 100644
@@ -45,7 +45,7 @@
 #define MAX_KEY_LEN     61
 #define KEY_BUF_SIZE    5
 
-#define	Rx_Smooth_Factor		20
+#define	RX_SMOOTH_FACTOR		20
 #define DMESG(x, a...)
 #define DMESGW(x, a...)
 #define DMESGE(x, a...)
drivers/staging/rtl8192u/r8192U_core.c +10 -10
index b3d32ea29fee..dd87cee6604b 100644
@@ -3975,13 +3975,13 @@ static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer,
 					pprevious_stats->RxMIMOSignalStrength[rfpath];
 			if (pprevious_stats->RxMIMOSignalStrength[rfpath]  > priv->stats.rx_rssi_percentage[rfpath]) {
 				priv->stats.rx_rssi_percentage[rfpath] =
-					((priv->stats.rx_rssi_percentage[rfpath] * (Rx_Smooth_Factor - 1)) +
-					 (pprevious_stats->RxMIMOSignalStrength[rfpath])) / (Rx_Smooth_Factor);
+					((priv->stats.rx_rssi_percentage[rfpath] * (RX_SMOOTH_FACTOR - 1)) +
+					 (pprevious_stats->RxMIMOSignalStrength[rfpath])) / (RX_SMOOTH_FACTOR);
 				priv->stats.rx_rssi_percentage[rfpath] = priv->stats.rx_rssi_percentage[rfpath]  + 1;
 			} else {
 				priv->stats.rx_rssi_percentage[rfpath] =
-					((priv->stats.rx_rssi_percentage[rfpath] * (Rx_Smooth_Factor - 1)) +
-					 (pprevious_stats->RxMIMOSignalStrength[rfpath])) / (Rx_Smooth_Factor);
+					((priv->stats.rx_rssi_percentage[rfpath] * (RX_SMOOTH_FACTOR - 1)) +
+					 (pprevious_stats->RxMIMOSignalStrength[rfpath])) / (RX_SMOOTH_FACTOR);
 			}
 			RT_TRACE(COMP_DBG,
 				 "priv->stats.rx_rssi_percentage[rfPath]  = %d\n",
@@ -4026,13 +4026,13 @@ static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer,
 				pprevious_stats->RxPWDBAll;
 		if (pprevious_stats->RxPWDBAll > (u32)priv->undecorated_smoothed_pwdb) {
 			priv->undecorated_smoothed_pwdb =
-				(((priv->undecorated_smoothed_pwdb) * (Rx_Smooth_Factor - 1)) +
-				 (pprevious_stats->RxPWDBAll)) / (Rx_Smooth_Factor);
+				(((priv->undecorated_smoothed_pwdb) * (RX_SMOOTH_FACTOR - 1)) +
+				 (pprevious_stats->RxPWDBAll)) / (RX_SMOOTH_FACTOR);
 			priv->undecorated_smoothed_pwdb = priv->undecorated_smoothed_pwdb + 1;
 		} else {
 			priv->undecorated_smoothed_pwdb =
-				(((priv->undecorated_smoothed_pwdb) * (Rx_Smooth_Factor - 1)) +
-				 (pprevious_stats->RxPWDBAll)) / (Rx_Smooth_Factor);
+				(((priv->undecorated_smoothed_pwdb) * (RX_SMOOTH_FACTOR - 1)) +
+				 (pprevious_stats->RxPWDBAll)) / (RX_SMOOTH_FACTOR);
 		}
 	}
 
@@ -4075,8 +4075,8 @@ static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer,
 					if (priv->stats.rx_evm_percentage[nspatial_stream] == 0) /* initialize */
 						priv->stats.rx_evm_percentage[nspatial_stream] = pprevious_stats->RxMIMOSignalQuality[nspatial_stream];
 					priv->stats.rx_evm_percentage[nspatial_stream] =
-						((priv->stats.rx_evm_percentage[nspatial_stream] * (Rx_Smooth_Factor - 1)) +
-						 (pprevious_stats->RxMIMOSignalQuality[nspatial_stream] * 1)) / (Rx_Smooth_Factor);
+						((priv->stats.rx_evm_percentage[nspatial_stream] * (RX_SMOOTH_FACTOR - 1)) +
+						 (pprevious_stats->RxMIMOSignalQuality[nspatial_stream] * 1)) / (RX_SMOOTH_FACTOR);
 				}
 			}
 		}
Signature · 1 line
2.18.0
#7 lore raw

PATCH 7/20 staging:rtl8192u: Refactor RT_TRACE - Style

In reply to John Whitmore

Refactor the MACRO RT_TRACE to add parentheses around the parameter 'component', this clears the checkpatch warning with respect to precedence issues.

This is a coding style change which should have no impact on runtime code execution.

---
 drivers/staging/rtl8192u/r8192U.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192u/r8192U.h +1 -1
index b5ad69af8dac..c613894a6088 100644
@@ -52,7 +52,7 @@
 extern u32 rt_global_debug_component;
 #define RT_TRACE(component, x, args...) \
 	do {							\
-		if (rt_global_debug_component & component)	\
+		if (rt_global_debug_component & (component))	\
 			pr_debug("RTL8192U: " x "\n", ##args);	\
 	} while (0)
 
Signature · 1 line
2.18.0
#8 lore raw

PATCH 8/20 staging:rtl8192u: Fix space characters - Style

In reply to John Whitmore

Fix the spacing issues, remove space after cast operation, and replace spaces at start of line with tab.

These changes are purely coding style changes to resolve checkpatch issues. There should be no impact on runtime code execution.

---
 drivers/staging/rtl8192u/r8192U.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/rtl8192u/r8192U.h +5 -5
index c613894a6088..e65a893fd084 100644
@@ -112,7 +112,7 @@ extern u32 rt_global_debug_component;
 	do {								\
 		if ((rt_global_debug_component & (level)) == (level)) {	\
 			int i;						\
-			u8 *pdata = (u8 *) data;			\
+			u8 *pdata = (u8 *)data;				\
 			pr_debug("RTL8192U: %s()\n", __func__);		\
 			for (i = 0; i < (int)(datalen); i++) {		\
 				printk("%2x ", pdata[i]);               \
@@ -877,9 +877,9 @@ typedef struct r8192_priv {
 	int     rx_inx;
 #endif
 
-       struct sk_buff_head rx_queue;
-       struct sk_buff_head skb_queue;
-       struct work_struct qos_activate;
+	struct sk_buff_head rx_queue;
+	struct sk_buff_head skb_queue;
+	struct work_struct qos_activate;
 	short  tx_urb_index;
 	atomic_t tx_pending[0x10]; /* UART_PRIORITY + 1 */
 
@@ -1027,7 +1027,7 @@ typedef struct r8192_priv {
 	u8	nrxAMPDU_aggr_num;
 
 	/* For gpio */
-	 bool bHwRadioOff;
+	bool bHwRadioOff;
 
 	u32 reset_count;
 	bool bpbc_pressed;
Signature · 1 line
2.18.0
#9 lore raw

PATCH 9/20 staging:rtl8192u: Remove RT_DEBUG_DATA - Style

In reply to John Whitmore

Remove the RT_DEBUG_DATA Macro. The macro causes a number of checkpatch issues, and is not actually used in code, so can simply be removed without issue.

This is a coding style change which should not impact runtime code execution.

---
 drivers/staging/rtl8192u/r8192U.h | 20 --------------------
 1 file changed, 20 deletions(-)
drivers/staging/rtl8192u/r8192U.h +0 -20
index e65a893fd084..528c50be3894 100644
@@ -103,28 +103,8 @@ extern u32 rt_global_debug_component;
 				 #expr, __FILE__, __func__, __LINE__);	\
 		}							\
 	} while (0)
-/*
- * Debug out data buf.
- * If you want to print DATA buffer related BA,
- * please set ieee80211_debug_level to DATA|BA
- */
-#define RT_DEBUG_DATA(level, data, datalen) \
-	do {								\
-		if ((rt_global_debug_component & (level)) == (level)) {	\
-			int i;						\
-			u8 *pdata = (u8 *)data;				\
-			pr_debug("RTL8192U: %s()\n", __func__);		\
-			for (i = 0; i < (int)(datalen); i++) {		\
-				printk("%2x ", pdata[i]);               \
-				if ((i+1)%16 == 0)			\
-					printk("\n");			\
-			}						\
-			printk("\n");					\
-		}							\
-	} while (0)
 #else
 #define RTL8192U_ASSERT(expr) do {} while (0)
-#define RT_DEBUG_DATA(level, data, datalen) do {} while (0)
 #endif /* RTL8169_DEBUG */
 
 /* Queue Select Value in TxDesc */
Signature · 1 line
2.18.0
#10 lore raw

PATCH 10/20 staging:rtl8192u: Rename PHY_Beacon_RSSI_SLID_WIN_MAX - Style

In reply to John Whitmore

Rename the Macro PHY_Beacon_RSSI_SLID_WIN_MAX to PHY_BEACON_RSSI_SLID_WIN_MAX, this clears the checkpatch issue with CamelCase naming.

This is purely a coding style change which should not impact runtime code execution.

---
 drivers/staging/rtl8192u/r8192U.h      | 2 +-
 drivers/staging/rtl8192u/r8192U_core.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/rtl8192u/r8192U.h +1 -1
index 528c50be3894..87c1a69b2e1c 100644
@@ -150,7 +150,7 @@ extern u32 rt_global_debug_component;
 #define RTL819X_DEFAULT_RF_TYPE RF_1T2R
 
 #define IEEE80211_WATCH_DOG_TIME    2000
-#define		PHY_Beacon_RSSI_SLID_WIN_MAX		10
+#define	PHY_BEACON_RSSI_SLID_WIN_MAX		10
 /* For Tx Power Tracking */
 #define		OFDM_Table_Length	19
 #define	CCK_Table_length	12
drivers/staging/rtl8192u/r8192U_core.c +3 -3
index dd87cee6604b..4d43176bdb6c 100644
@@ -3997,15 +3997,15 @@ static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer,
 
 	if (pprevious_stats->bPacketBeacon) {
 		/* record the beacon pwdb to the sliding window. */
-		if (slide_beacon_adc_pwdb_statistics++ >= PHY_Beacon_RSSI_SLID_WIN_MAX) {
-			slide_beacon_adc_pwdb_statistics = PHY_Beacon_RSSI_SLID_WIN_MAX;
+		if (slide_beacon_adc_pwdb_statistics++ >= PHY_BEACON_RSSI_SLID_WIN_MAX) {
+			slide_beacon_adc_pwdb_statistics = PHY_BEACON_RSSI_SLID_WIN_MAX;
 			last_beacon_adc_pwdb = priv->stats.Slide_Beacon_pwdb[slide_beacon_adc_pwdb_index];
 			priv->stats.Slide_Beacon_Total -= last_beacon_adc_pwdb;
 		}
 		priv->stats.Slide_Beacon_Total += pprevious_stats->RxPWDBAll;
 		priv->stats.Slide_Beacon_pwdb[slide_beacon_adc_pwdb_index] = pprevious_stats->RxPWDBAll;
 		slide_beacon_adc_pwdb_index++;
-		if (slide_beacon_adc_pwdb_index >= PHY_Beacon_RSSI_SLID_WIN_MAX)
+		if (slide_beacon_adc_pwdb_index >= PHY_BEACON_RSSI_SLID_WIN_MAX)
 			slide_beacon_adc_pwdb_index = 0;
 		pprevious_stats->RxPWDBAll = priv->stats.Slide_Beacon_Total / slide_beacon_adc_pwdb_statistics;
 		if (pprevious_stats->RxPWDBAll >= 3)
Signature · 1 line
2.18.0
#11 lore raw

PATCH 11/20 staging:rtl8192u: Rename OFDM_Table_Length - Style

In reply to John Whitmore

Rename the defined constant OFDM_Table_Length to OFDM_TABLE_LENGTH, this clears the checkpatch issue with CamelCase naming.

This is a simple coding style change which should not impact runtime code execution.

---
 drivers/staging/rtl8192u/r8192U.h    | 2 +-
 drivers/staging/rtl8192u/r8192U_dm.c | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/staging/rtl8192u/r8192U.h +1 -1
index 87c1a69b2e1c..6edbc8146e82 100644
@@ -152,7 +152,7 @@ extern u32 rt_global_debug_component;
 #define IEEE80211_WATCH_DOG_TIME    2000
 #define	PHY_BEACON_RSSI_SLID_WIN_MAX		10
 /* For Tx Power Tracking */
-#define		OFDM_Table_Length	19
+#define		OFDM_TABLE_LENGTH	19
 #define	CCK_Table_length	12
 
 /* For rtl819x */
drivers/staging/rtl8192u/r8192U_dm.c +4 -4
index 5fb5f583f703..19b3b11c5edb 100644
@@ -454,7 +454,7 @@ static void dm_bandwidth_autoswitch(struct net_device *dev)
 }	/* dm_BandwidthAutoSwitch */
 
 /* OFDM default at 0db, index=6. */
-static u32 OFDMSwingTable[OFDM_Table_Length] = {
+static u32 OFDMSwingTable[OFDM_TABLE_LENGTH] = {
 	0x7f8001fe,	/* 0, +6db */
 	0x71c001c7,	/* 1, +5db */
 	0x65400195,	/* 2, +4db */
@@ -672,7 +672,7 @@ static void dm_TXPowerTrackingCallback_ThermalMeter(struct net_device *dev)
 	if (!priv->btxpower_trackingInit) {
 		/* Query OFDM default setting */
 		tmpRegA = rtl8192_QueryBBReg(dev, rOFDM0_XATxIQImbalance, bMaskDWord);
-		for (i = 0; i < OFDM_Table_Length; i++) { /* find the index */
+		for (i = 0; i < OFDM_TABLE_LENGTH; i++) { /* find the index */
 			if (tmpRegA == OFDMSwingTable[i]) {
 				priv->OFDM_index = (u8)i;
 				RT_TRACE(COMP_POWER_TRACKING, "Initial reg0x%x = 0x%x, OFDM_index=0x%x\n",
@@ -716,8 +716,8 @@ static void dm_TXPowerTrackingCallback_ThermalMeter(struct net_device *dev)
 	if (priv->ThermalMeter[0] >= (u8)tmpRegA) {	/* lower temperature */
 		tmpOFDMindex = tmpCCK20Mindex = 6+(priv->ThermalMeter[0]-(u8)tmpRegA);
 		tmpCCK40Mindex = tmpCCK20Mindex - 6;
-		if (tmpOFDMindex >= OFDM_Table_Length)
-			tmpOFDMindex = OFDM_Table_Length-1;
+		if (tmpOFDMindex >= OFDM_TABLE_LENGTH)
+			tmpOFDMindex = OFDM_TABLE_LENGTH - 1;
 		if (tmpCCK20Mindex >= CCK_Table_length)
 			tmpCCK20Mindex = CCK_Table_length-1;
 		if (tmpCCK40Mindex >= CCK_Table_length)
Signature · 1 line
2.18.0
#12 lore raw

PATCH 12/20 staging:rtl8192u: Rename CCK_Table_length - Style

In reply to John Whitmore

Rename the constant CCK_Table_length to CCK_TABLE_LENGTH, this clears the checkpatch issue with CamelCase naming.

This is a simple coding style change which should not impact runtime code execution.

---
 drivers/staging/rtl8192u/r8192U.h    |  2 +-
 drivers/staging/rtl8192u/r8192U_dm.c | 14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)
drivers/staging/rtl8192u/r8192U.h +1 -1
index 6edbc8146e82..e86a4b35a1f4 100644
@@ -153,7 +153,7 @@ extern u32 rt_global_debug_component;
 #define	PHY_BEACON_RSSI_SLID_WIN_MAX		10
 /* For Tx Power Tracking */
 #define		OFDM_TABLE_LENGTH	19
-#define	CCK_Table_length	12
+#define	CCK_TABLE_LENGTH	12
 
 /* For rtl819x */
 struct tx_desc_819x_usb {
drivers/staging/rtl8192u/r8192U_dm.c +7 -7
index 19b3b11c5edb..874da0620936 100644
@@ -476,7 +476,7 @@ static u32 OFDMSwingTable[OFDM_TABLE_LENGTH] = {
 	0x10000040	/* 18, -12db */
 };
 
-static u8	CCKSwingTable_Ch1_Ch13[CCK_Table_length][8] = {
+static u8	CCKSwingTable_Ch1_Ch13[CCK_TABLE_LENGTH][8] = {
 	{0x36, 0x35, 0x2e, 0x25, 0x1c, 0x12, 0x09, 0x04},	/* 0, +0db ===> CCK40M default */
 	{0x30, 0x2f, 0x29, 0x21, 0x19, 0x10, 0x08, 0x03},	/* 1, -1db */
 	{0x2b, 0x2a, 0x25, 0x1e, 0x16, 0x0e, 0x07, 0x03},	/* 2, -2db */
@@ -491,7 +491,7 @@ static u8	CCKSwingTable_Ch1_Ch13[CCK_Table_length][8] = {
 	{0x0f, 0x0f, 0x0d, 0x0b, 0x08, 0x05, 0x03, 0x01}	/* 11, -11db */
 };
 
-static u8	CCKSwingTable_Ch14[CCK_Table_length][8] = {
+static u8	CCKSwingTable_Ch14[CCK_TABLE_LENGTH][8] = {
 	{0x36, 0x35, 0x2e, 0x1b, 0x00, 0x00, 0x00, 0x00},	/* 0, +0db  ===> CCK40M default */
 	{0x30, 0x2f, 0x29, 0x18, 0x00, 0x00, 0x00, 0x00},	/* 1, -1db */
 	{0x2b, 0x2a, 0x25, 0x15, 0x00, 0x00, 0x00, 0x00},	/* 2, -2db */
@@ -682,7 +682,7 @@ static void dm_TXPowerTrackingCallback_ThermalMeter(struct net_device *dev)
 
 		/* Query CCK default setting From 0xa22 */
 		TempCCk = rtl8192_QueryBBReg(dev, rCCK0_TxFilter1, bMaskByte2);
-		for (i = 0; i < CCK_Table_length; i++) {
+		for (i = 0; i < CCK_TABLE_LENGTH; i++) {
 			if (TempCCk == (u32)CCKSwingTable_Ch1_Ch13[i][0]) {
 				priv->CCK_index = (u8) i;
 				RT_TRACE(COMP_POWER_TRACKING, "Initial reg0x%x = 0x%x, CCK_index=0x%x\n",
@@ -718,10 +718,10 @@ static void dm_TXPowerTrackingCallback_ThermalMeter(struct net_device *dev)
 		tmpCCK40Mindex = tmpCCK20Mindex - 6;
 		if (tmpOFDMindex >= OFDM_TABLE_LENGTH)
 			tmpOFDMindex = OFDM_TABLE_LENGTH - 1;
-		if (tmpCCK20Mindex >= CCK_Table_length)
-			tmpCCK20Mindex = CCK_Table_length-1;
-		if (tmpCCK40Mindex >= CCK_Table_length)
-			tmpCCK40Mindex = CCK_Table_length-1;
+		if (tmpCCK20Mindex >= CCK_TABLE_LENGTH)
+			tmpCCK20Mindex = CCK_TABLE_LENGTH - 1;
+		if (tmpCCK40Mindex >= CCK_TABLE_LENGTH)
+			tmpCCK40Mindex = CCK_TABLE_LENGTH - 1;
 	} else {
 		tmpval = (u8)tmpRegA - priv->ThermalMeter[0];
 
Signature · 1 line
2.18.0
#13 lore raw

PATCH 13/20 staging:rtl8192u: Rename PktSize Style

In reply to John Whitmore

Rename the member variable 'PktSize' to 'pkt_size', this change clears the checkpatch issue with CamelCase naming.

This is a simple coding style change which should not impact runtime code execution.

---
 drivers/staging/rtl8192u/r8192U.h      | 2 +-
 drivers/staging/rtl8192u/r8192U_core.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/r8192U.h +1 -1
index e86a4b35a1f4..9931ede1524b 100644
@@ -158,7 +158,7 @@ extern u32 rt_global_debug_component;
 /* For rtl819x */
 struct tx_desc_819x_usb {
 	/* DWORD 0 */
-	u16	PktSize;
+	u16	pkt_size;
 	u8	Offset;
 	u8	Reserved0:3;
 	u8	CmdInit:1;
drivers/staging/rtl8192u/r8192U_core.c +1 -1
index 4d43176bdb6c..2a3cb0f1ac07 100644
@@ -1517,7 +1517,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb)
 	tx_desc->LINIP = 0;
 	tx_desc->CmdInit = 1;
 	tx_desc->Offset =  sizeof(struct tx_fwinfo_819x_usb) + 8;
-	tx_desc->PktSize = (skb->len - TX_PACKET_SHIFT_BYTES) & 0xffff;
+	tx_desc->pkt_size = (skb->len - TX_PACKET_SHIFT_BYTES) & 0xffff;
 
 	/*DWORD 1*/
 	tx_desc->SecCAMID = 0;
Signature · 1 line
2.18.0
#14 lore raw

PATCH 14/20 staging:rtl8192u: Rename Offset - Style

In reply to John Whitmore

Rename the member variable 'Offset' to 'offset', this clears the checkpatch issue with CamelCase naming.

This is a coding style change which should not impact runtime code execution.

---
 drivers/staging/rtl8192u/r8192U.h      | 2 +-
 drivers/staging/rtl8192u/r8192U_core.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/r8192U.h +1 -1
index 9931ede1524b..8aaea1d8cf50 100644
@@ -159,7 +159,7 @@ extern u32 rt_global_debug_component;
 struct tx_desc_819x_usb {
 	/* DWORD 0 */
 	u16	pkt_size;
-	u8	Offset;
+	u8	offset;
 	u8	Reserved0:3;
 	u8	CmdInit:1;
 	u8	LastSeg:1;
drivers/staging/rtl8192u/r8192U_core.c +1 -1
index 2a3cb0f1ac07..d4af6cc01fc6 100644
@@ -1516,7 +1516,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb)
 	/* DWORD 0 */
 	tx_desc->LINIP = 0;
 	tx_desc->CmdInit = 1;
-	tx_desc->Offset =  sizeof(struct tx_fwinfo_819x_usb) + 8;
+	tx_desc->offset =  sizeof(struct tx_fwinfo_819x_usb) + 8;
 	tx_desc->pkt_size = (skb->len - TX_PACKET_SHIFT_BYTES) & 0xffff;
 
 	/*DWORD 1*/
Signature · 1 line
2.18.0
#15 lore raw

PATCH 15/20 staging:rtl8192u: Rename Reserved... structure members - Style

In reply to John Whitmore

Rename the 'Reserved...' members of the 'tx_desc_819x_usb' structure to 'reserved...'. This change clears the checkpatch issue with CamelCase naming.

This is a simple coding style change which should not impact runtime code execution.

---
 drivers/staging/rtl8192u/r8192U.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/rtl8192u/r8192U.h +7 -7
index 8aaea1d8cf50..5d643870a1e3 100644
@@ -160,7 +160,7 @@ struct tx_desc_819x_usb {
 	/* DWORD 0 */
 	u16	pkt_size;
 	u8	offset;
-	u8	Reserved0:3;
+	u8	reserved0:3;
 	u8	CmdInit:1;
 	u8	LastSeg:1;
 	u8	FirstSeg:1;
@@ -177,7 +177,7 @@ struct tx_desc_819x_usb {
 	u8	PIFS:1;
 	u8	QueueSelect:5;
 	u8	NoACM:1;
-	u8	Reserved1:2;
+	u8	reserved1:2;
 	u8	SecCAMID:5;
 	u8	SecDescAssign:1;
 	u8	SecType:2;
@@ -185,13 +185,13 @@ struct tx_desc_819x_usb {
 	/* DWORD 2 */
 	u16	TxBufferSize;
 	u8	ResvForPaddingLen:7;
-	u8	Reserved3:1;
-	u8	Reserved4;
+	u8	reserved3:1;
+	u8	reserved4;
 
 	/* DWORD 3, 4, 5 */
-	u32	Reserved5;
-	u32	Reserved6;
-	u32	Reserved7;
+	u32	reserved5;
+	u32	reserved6;
+	u32	reserved7;
 };
 
 struct tx_desc_cmd_819x_usb {
Signature · 1 line
2.18.0
#16 lore raw

PATCH 16/20 staging:rtl8192u: Rename CmdInit - Style

In reply to John Whitmore

Rename the member variable 'CmdInit, to 'cmd_init', this change clears the checkpatch issue with CamelCase naming.

This is a simple coding style change which should have no impact on runtime code execution.

---
 drivers/staging/rtl8192u/r8192U.h      | 2 +-
 drivers/staging/rtl8192u/r8192U_core.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/r8192U.h +1 -1
index 5d643870a1e3..4d29b7427a0e 100644
@@ -161,7 +161,7 @@ struct tx_desc_819x_usb {
 	u16	pkt_size;
 	u8	offset;
 	u8	reserved0:3;
-	u8	CmdInit:1;
+	u8	cmd_init:1;
 	u8	LastSeg:1;
 	u8	FirstSeg:1;
 	u8	LINIP:1;
drivers/staging/rtl8192u/r8192U_core.c +1 -1
index d4af6cc01fc6..b385c686370b 100644
@@ -1515,7 +1515,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb)
 	memset(tx_desc, 0, sizeof(struct tx_desc_819x_usb));
 	/* DWORD 0 */
 	tx_desc->LINIP = 0;
-	tx_desc->CmdInit = 1;
+	tx_desc->cmd_init = 1;
 	tx_desc->offset =  sizeof(struct tx_fwinfo_819x_usb) + 8;
 	tx_desc->pkt_size = (skb->len - TX_PACKET_SHIFT_BYTES) & 0xffff;
 
Signature · 1 line
2.18.0
#17 lore raw

PATCH 17/20 staging:rtl8192u: Rename LastSeg - Style

In reply to John Whitmore

Rename the member variable 'LastSeg' to 'last_seg', this change clears the checkpatch issue with CamelCase naming.

This is a simple coding style change which should not impact runtime code execution.

---
 drivers/staging/rtl8192u/r8192U.h      | 2 +-
 drivers/staging/rtl8192u/r8192U_core.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/r8192U.h +1 -1
index 4d29b7427a0e..672cbfa688f7 100644
@@ -162,7 +162,7 @@ struct tx_desc_819x_usb {
 	u8	offset;
 	u8	reserved0:3;
 	u8	cmd_init:1;
-	u8	LastSeg:1;
+	u8	last_seg:1;
 	u8	FirstSeg:1;
 	u8	LINIP:1;
 	u8	OWN:1;
drivers/staging/rtl8192u/r8192U_core.c +1 -1
index b385c686370b..dfbba1177470 100644
@@ -1557,7 +1557,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb)
 	 */
 	/* DWORD 0 */
 	tx_desc->FirstSeg = 1;
-	tx_desc->LastSeg = 1;
+	tx_desc->last_seg = 1;
 	tx_desc->OWN = 1;
 
 	/* DWORD 2 */
Signature · 1 line
2.18.0
#18 lore raw

PATCH 18/20 staging:rtl8192u: Rename FirstSeg - Style

In reply to John Whitmore

Rename the member variable 'FirstSeg' to 'first_seg', this change clears the checkpatch issue with CamelCase naming.

This is a simple coding style change and as such should not impact runtime code execution.

---
 drivers/staging/rtl8192u/r8192U.h      | 2 +-
 drivers/staging/rtl8192u/r8192U_core.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/r8192U.h +1 -1
index 672cbfa688f7..66efa59eabf0 100644
@@ -163,7 +163,7 @@ struct tx_desc_819x_usb {
 	u8	reserved0:3;
 	u8	cmd_init:1;
 	u8	last_seg:1;
-	u8	FirstSeg:1;
+	u8	first_seg:1;
 	u8	LINIP:1;
 	u8	OWN:1;
 
drivers/staging/rtl8192u/r8192U_core.c +1 -1
index dfbba1177470..a4d1b55a1117 100644
@@ -1556,7 +1556,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb)
 	 * all of the descriptors
 	 */
 	/* DWORD 0 */
-	tx_desc->FirstSeg = 1;
+	tx_desc->first_seg = 1;
 	tx_desc->last_seg = 1;
 	tx_desc->OWN = 1;
 
Signature · 1 line
2.18.0
maintainer
#19 lore raw

Re: [PATCH 18/20] staging:rtl8192u: Rename FirstSeg - Style

Quoted 30 lines · John Whitmore

Rename the member variable 'FirstSeg' to 'first_seg', this change clears the checkpatch issue with CamelCase naming.

This is a simple coding style change and as such should not impact runtime code execution.

---
 drivers/staging/rtl8192u/r8192U.h      | 2 +-
 drivers/staging/rtl8192u/r8192U_core.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/r8192U.h +1 -1
index 672cbfa688f7..66efa59eabf0 100644
@@ -163,7 +163,7 @@ struct tx_desc_819x_usb {
 	u8	reserved0:3;
 	u8	cmd_init:1;
 	u8	last_seg:1;
-	u8	FirstSeg:1;
+	u8	first_seg:1;
 	u8	LINIP:1;
 	u8	OWN:1;
 
drivers/staging/rtl8192u/r8192U_core.c +0 -0
index dfbba1177470..a4d1b55a1117 100644

drivers/staging/rtl8192u/r8192U_core.c short rtl8192_tx(struct net_device *dev, struct sk_buff *skb) · line 1559

Quoted 5 lines
drivers/staging/rtl8192u/r8192U_core.c +1 -1
@@ -1556,7 +1556,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb)
 	 * all of the descriptors
 	 */
 	/* DWORD 0 */
-	tx_desc->FirstSeg = 1;
+	tx_desc->first_seg = 1;

Same for all of these, I'll let you respin this patch series...

thanks,

greg k-h

#20 lore raw

PATCH 19/20 staging:rtl8192u: Rename LINIP - Style

In reply to John Whitmore

Rename the member variable 'LINIP' to 'linip', this change is to conform to the coding style guidelines, member variables in lowercase.

This is a simple coding style change which should not impact runtime code execution.

---
 drivers/staging/rtl8192u/r8192U.h      | 2 +-
 drivers/staging/rtl8192u/r8192U_core.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/r8192U.h +1 -1
index 66efa59eabf0..68e82b32a88e 100644
@@ -164,7 +164,7 @@ struct tx_desc_819x_usb {
 	u8	cmd_init:1;
 	u8	last_seg:1;
 	u8	first_seg:1;
-	u8	LINIP:1;
+	u8	linip:1;
 	u8	OWN:1;
 
 	/* DWORD 1 */
drivers/staging/rtl8192u/r8192U_core.c +1 -1
index a4d1b55a1117..911d0214b48a 100644
@@ -1514,7 +1514,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb)
 	/* Fill Tx descriptor */
 	memset(tx_desc, 0, sizeof(struct tx_desc_819x_usb));
 	/* DWORD 0 */
-	tx_desc->LINIP = 0;
+	tx_desc->linip = 0;
 	tx_desc->cmd_init = 1;
 	tx_desc->offset =  sizeof(struct tx_fwinfo_819x_usb) + 8;
 	tx_desc->pkt_size = (skb->len - TX_PACKET_SHIFT_BYTES) & 0xffff;
Signature · 1 line
2.18.0
maintainer
#21 lore raw

Re: [PATCH 19/20] staging:rtl8192u: Rename LINIP - Style

Quoted 31 lines · John Whitmore

Rename the member variable 'LINIP' to 'linip', this change is to conform to the coding style guidelines, member variables in lowercase.

This is a simple coding style change which should not impact runtime code execution.

---
 drivers/staging/rtl8192u/r8192U.h      | 2 +-
 drivers/staging/rtl8192u/r8192U_core.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/r8192U.h +1 -1
index 66efa59eabf0..68e82b32a88e 100644
@@ -164,7 +164,7 @@ struct tx_desc_819x_usb {
 	u8	cmd_init:1;
 	u8	last_seg:1;
 	u8	first_seg:1;
-	u8	LINIP:1;
+	u8	linip:1;
 	u8	OWN:1;
 
 	/* DWORD 1 */
drivers/staging/rtl8192u/r8192U_core.c +0 -0
index a4d1b55a1117..911d0214b48a 100644

drivers/staging/rtl8192u/r8192U_core.c short rtl8192_tx(struct net_device *dev, struct sk_buff *skb) · line 1517

Quoted 5 lines
drivers/staging/rtl8192u/r8192U_core.c +1 -1
@@ -1514,7 +1514,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb)
 	/* Fill Tx descriptor */
 	memset(tx_desc, 0, sizeof(struct tx_desc_819x_usb));
 	/* DWORD 0 */
-	tx_desc->LINIP = 0;
+	tx_desc->linip = 0;

Please just delet.

#22 lore raw

PATCH 20/20 staging:rtl8192u: Rename OWN - Style

In reply to John Whitmore

Rename the member variable 'OWN' to 'own', this is to comply with the coding standard, where variables are named in lowercase.

This is a simple coding style change which should have no impact on runtime code execution.

---
 drivers/staging/rtl8192u/r8192U.h      | 2 +-
 drivers/staging/rtl8192u/r8192U_core.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/r8192U.h +1 -1
index 68e82b32a88e..f963b664e221 100644
@@ -165,7 +165,7 @@ struct tx_desc_819x_usb {
 	u8	last_seg:1;
 	u8	first_seg:1;
 	u8	linip:1;
-	u8	OWN:1;
+	u8	own:1;
 
 	/* DWORD 1 */
 	u8	TxFWInfoSize;
drivers/staging/rtl8192u/r8192U_core.c +1 -1
index 911d0214b48a..4d0f70ec31ac 100644
@@ -1558,7 +1558,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb)
 	/* DWORD 0 */
 	tx_desc->first_seg = 1;
 	tx_desc->last_seg = 1;
-	tx_desc->OWN = 1;
+	tx_desc->own = 1;
 
 	/* DWORD 2 */
 	tx_desc->TxBufferSize = (u32)(skb->len - USB_HWDESC_HEADER_LEN);
Signature · 1 line
2.18.0
maintainer
#23 lore raw

Re: [PATCH 20/20] staging:rtl8192u: Rename OWN - Style

Quoted 30 lines · John Whitmore

Rename the member variable 'OWN' to 'own', this is to comply with the coding standard, where variables are named in lowercase.

This is a simple coding style change which should have no impact on runtime code execution.

---
 drivers/staging/rtl8192u/r8192U.h      | 2 +-
 drivers/staging/rtl8192u/r8192U_core.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/r8192U.h +1 -1
index 68e82b32a88e..f963b664e221 100644
@@ -165,7 +165,7 @@ struct tx_desc_819x_usb {
 	u8	last_seg:1;
 	u8	first_seg:1;
 	u8	linip:1;
-	u8	OWN:1;
+	u8	own:1;
 
 	/* DWORD 1 */
 	u8	TxFWInfoSize;
drivers/staging/rtl8192u/r8192U_core.c +0 -0
index 911d0214b48a..4d0f70ec31ac 100644

drivers/staging/rtl8192u/r8192U_core.c short rtl8192_tx(struct net_device *dev, struct sk_buff *skb) · line 1561

Quoted 5 lines
drivers/staging/rtl8192u/r8192U_core.c +1 -1
@@ -1558,7 +1558,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb)
 	/* DWORD 0 */
 	tx_desc->first_seg = 1;
 	tx_desc->last_seg = 1;
-	tx_desc->OWN = 1;
+	tx_desc->own = 1;

Is this another case of a variable being set once and then never used?

If so, just delete it.

thanks,

greg k-h

#24 lore raw

Re: [PATCH 20/20] staging:rtl8192u: Rename OWN - Style

Quoted 39 lines · Greg KH
Quoted 30 lines · John Whitmore

Rename the member variable 'OWN' to 'own', this is to comply with the coding standard, where variables are named in lowercase.

This is a simple coding style change which should have no impact on runtime code execution.

---
 drivers/staging/rtl8192u/r8192U.h      | 2 +-
 drivers/staging/rtl8192u/r8192U_core.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/r8192U.h +1 -1
index 68e82b32a88e..f963b664e221 100644
@@ -165,7 +165,7 @@ struct tx_desc_819x_usb {
 	u8	last_seg:1;
 	u8	first_seg:1;
 	u8	linip:1;
-	u8	OWN:1;
+	u8	own:1;
 
 	/* DWORD 1 */
 	u8	TxFWInfoSize;
drivers/staging/rtl8192u/r8192U_core.c +0 -0
index 911d0214b48a..4d0f70ec31ac 100644

drivers/staging/rtl8192u/r8192U_core.c short rtl8192_tx(struct net_device *dev, struct sk_buff *skb) · line 1561

Quoted 5 lines
drivers/staging/rtl8192u/r8192U_core.c +1 -1
@@ -1558,7 +1558,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb)
 	/* DWORD 0 */
 	tx_desc->first_seg = 1;
 	tx_desc->last_seg = 1;
-	tx_desc->OWN = 1;
+	tx_desc->own = 1;

Is this another case of a variable being set once and then never used?

Quoted 5 lines

If so, just delete it.

thanks,

greg k-h

em, I wasn't sure because that variable's a memeber of the sk_buff * passed into the funtion. That function should be static to the file and is only called from function rtl8192_hard_start_xmit() but that's a function pointer which is sort of exported:

        priv->ieee80211->softmac_hard_start_xmit = rtl8192_hard_start_xmit;

Having said that the 'OWN' member is part of the private data:

	struct tx_desc_819x_usb *tx_desc = (struct tx_desc_819x_usb *)skb->data;

Like I say I wasn't sure so played it safe. I guess it's private data so nobody outside the driver should be messing with that data, and I'm not sure how public that function is.

I'll read some, ponder a bit and have another go.

jwhitmore