Skip to contentSkip to conversation

Staging: rtl8192u: Avoid typedefs for structure

PATCH Superseded Bhanusree Pola 2 participants 12 messages Mar 10, 2019 Staging

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover Staging: rtl8192u: Avoid typedefs for structure

This patch series removes typedefs for various structure types.

v2:
-Modify the driver such that kernel should compile at all times. -typedef is removed and then updated the uses in the same patch. -Struct names chosen according to Linux Kernel Coding Style. -Series with one patch per structure is done.

Bhanusree Pola (5):
Staging: rtl8192u: Remove typedef for struct _bandwidth_autoswitch
Staging: rtl8192u: Remove typedef for struct _IbssParms
Staging: rtl8192u: Remove typedef for struct _RT_POWER_SAVE_CONTROL
Staging: rtl8192u: Remove typedef for struct _RT_LINK_DETECT_T
Staging: rtl8192u: Remove typedef for struct _RX_REORDER_ENTRY

 .../staging/rtl8192u/ieee80211/ieee80211.h    | 30 +++++++++----------
 .../staging/rtl8192u/ieee80211/ieee80211_rx.c | 12 ++++----
 .../rtl8192u/ieee80211/rtl819x_TSProc.c       | 10 +++----
 3 files changed, 26 insertions(+), 26 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/5 Staging: rtl8192u: Remove typedef for struct _bandwidth_autoswitch

-Avoid typedefs for structure types to maintain kernel coding style. -Remove typedefs bandwidth_autoswitch and *pbandwidth_autoswitch of struct _bandwidth_autoswitch.
-Change Structure name _bandwidth_autoswitch to bandwidth_autoswitch to maintain Linux kernel Coding Style.
-Replace occurences of bandwidth_autoswitch to struct bandwidth_autoswitch.

---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211.h +3 -3
index 8aa536d79900..ce79b8321961 100644
@@ -1462,12 +1462,12 @@ struct tx_pending {
 	struct ieee80211_txb *txb;
 };
 
-typedef struct _bandwidth_autoswitch {
+struct bandwidth_autoswitch {
 	long threshold_20Mhzto40Mhz;
 	long	threshold_40Mhzto20Mhz;
 	bool bforced_tx20Mhz;
 	bool bautoswitch_enable;
-} bandwidth_autoswitch, *pbandwidth_autoswitch;
+};
 
 
 //added by amy for order
@@ -1871,7 +1871,7 @@ struct ieee80211_device {
 	Fsync_State			fsync_state;
 	bool		bis_any_nonbepkts;
 	//20Mhz 40Mhz AutoSwitch Threshold
-	bandwidth_autoswitch bandwidth_auto_switch;
+	struct bandwidth_autoswitch bandwidth_auto_switch;
 	//for txpower tracking
 	bool FwRWRF;
 
Signature · 1 line
2.17.1
#2 lore raw

PATCH v2 2/5 Staging: rtl8192u: Remove typedef for struct _IbssParms

In reply to Bhanusree Pola

-Avoid typedefs for structure types to maintain kernel coding style. -Remove typedefs IbssParms and *PIbssParms of struct _IbssParms.
-Change Structure name _IbssParms to ibss_parms to maintain Linux kernel Coding Style. -Replace occurences of IbssParms to struct ibss_parms.

---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211.h +3 -3
index ce79b8321961..735e86cc6adc 100644
@@ -1506,9 +1506,9 @@ typedef enum _RT_JOIN_ACTION {
 	RT_NO_ACTION  = 4,
 } RT_JOIN_ACTION;
 
-typedef struct _IbssParms {
+struct ibss_parms {
 	u16   atimWin;
-} IbssParms, *PIbssParms;
+};
 #define MAX_NUM_RATES	264 // Max num of support rates element: 8,  Max num of ext. support rate: 255. 061122, by rcnjko.
 
 // RF state.
@@ -1554,7 +1554,7 @@ typedef struct _RT_POWER_SAVE_CONTROL {
 	struct octet_string			tmpSuppRateSet;
 	u8					tmpSuppRateBuf[MAX_NUM_RATES];
 	bool				bTmpSuppRate;
-	IbssParms				tmpIbpm;
+	struct ibss_parms				tmpIbpm;
 	bool				bTmpIbpm;
 
 	//
Signature · 1 line
2.17.1
#3 lore raw

Re: [Outreachy kernel] [PATCH v2 2/5] Staging: rtl8192u: Remove typedef for struct _IbssParms

Quoted 27 lines · Bhanusree Pola
(quoted diff) +0 -4
-Avoid typedefs for structure types to maintain kernel coding style.
-Remove typedefs IbssParms and *PIbssParms of struct _IbssParms.
-Change Structure name _IbssParms to ibss_parms to maintain Linux kernel Coding Style.
-Replace occurences of IbssParms to struct ibss_parms.
---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211.h +2 -2
index ce79b8321961..735e86cc6adc 100644
@@ -1506,9 +1506,9 @@ typedef enum _RT_JOIN_ACTION {
 	RT_NO_ACTION  = 4,
 } RT_JOIN_ACTION;
 
-typedef struct _IbssParms {
+struct ibss_parms {
 	u16   atimWin;
-} IbssParms, *PIbssParms;
+};
 #define MAX_NUM_RATES	264 // Max num of support rates element: 8,  Max num of ext. support rate: 255. 061122, by rcnjko.
 
 // RF state.

drivers/staging/rtl8192u/ieee80211/ieee80211.h typedef struct _RT_POWER_SAVE_CONTROL { · line 1557

Quoted 5 lines
drivers/staging/rtl8192u/ieee80211/ieee80211.h +1 -1
@@ -1554,7 +1554,7 @@ typedef struct _RT_POWER_SAVE_CONTROL {
 	struct octet_string			tmpSuppRateSet;
 	u8					tmpSuppRateBuf[MAX_NUM_RATES];
 	bool				bTmpSuppRate;
-	IbssParms				tmpIbpm;
+	struct ibss_parms				tmpIbpm;

I don't know why the fields aren't lined up in this structure, but you should at least not make the situation worse. There should be one less tab in front of tmpIbpm.

julia

Quoted 13 lines
drivers/staging/rtl8192u/ieee80211/ieee80211.h +0 -1
 	bool				bTmpIbpm;
 
 	//
--

2.17.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20190310174635.16923-3-bhanusreemahesh%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#4 lore raw

PATCH v2 3/5 Staging: rtl8192u: Remove typedef for struct _RT_POWER_SAVE_CONTROL

In reply to Bhanusree Pola

-Avoid typedefs for structure types to maintain kernel coding style.
-Remove typedefs RT_POWER_SAVE_CONTROL and *PRT_POWER_SAVE_CONTROL of struct _RT_POWER_SAVE_CONTROL. -Change Structure name _RT_POWER_SAVE_CONTROL to rt_power_save_control to maintain Linux kernel Coding Style. -Replace occurences of _RT_POWER_SAVE_CONTROL to struct rt_power_save_control.

---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211.h +3 -3
index 735e86cc6adc..152854fc09f8 100644
@@ -1518,7 +1518,7 @@ typedef	enum _RT_RF_POWER_STATE {
 	eRfOff
 } RT_RF_POWER_STATE;
 
-typedef struct _RT_POWER_SAVE_CONTROL {
+struct rt_power_save_control {
 
 	//
 	// Inactive Power Save(IPS) : Disable RF when disconnected
@@ -1562,7 +1562,7 @@ typedef struct _RT_POWER_SAVE_CONTROL {
 	//
 	bool				bLeisurePs;
 
-} RT_POWER_SAVE_CONTROL, *PRT_POWER_SAVE_CONTROL;
+};
 
 typedef u32 RT_RF_CHANGE_SOURCE;
 #define RF_CHANGE_BY_SW		BIT(31)
@@ -1878,7 +1878,7 @@ struct ieee80211_device {
 	//added by amy for AP roaming
 	RT_LINK_DETECT_T	LinkDetectInfo;
 	//added by amy for ps
-	RT_POWER_SAVE_CONTROL	PowerSaveControl;
+	struct rt_power_save_control	PowerSaveControl;
 //}
 	/* used if IEEE_SOFTMAC_TX_QUEUE is set */
 	struct  tx_pending tx_pending;
Signature · 1 line
2.17.1
#5 lore raw

Re: [Outreachy kernel] [PATCH v2 3/5] Staging: rtl8192u: Remove typedef for struct _RT_POWER_SAVE_CONTROL

Quoted 33 lines · Bhanusree Pola
(quoted diff) +0 -4
-Avoid typedefs for structure types to maintain kernel coding style.
-Remove typedefs RT_POWER_SAVE_CONTROL and *PRT_POWER_SAVE_CONTROL of struct _RT_POWER_SAVE_CONTROL.
-Change Structure name _RT_POWER_SAVE_CONTROL to rt_power_save_control to maintain Linux kernel Coding Style.
-Replace occurences of _RT_POWER_SAVE_CONTROL to struct rt_power_save_control.
---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211.h +2 -2
index 735e86cc6adc..152854fc09f8 100644
@@ -1518,7 +1518,7 @@ typedef	enum _RT_RF_POWER_STATE {
 	eRfOff
 } RT_RF_POWER_STATE;
 
-typedef struct _RT_POWER_SAVE_CONTROL {
+struct rt_power_save_control {
 
 	//
 	// Inactive Power Save(IPS) : Disable RF when disconnected
@@ -1562,7 +1562,7 @@ typedef struct _RT_POWER_SAVE_CONTROL {
 	//
 	bool				bLeisurePs;
 
-} RT_POWER_SAVE_CONTROL, *PRT_POWER_SAVE_CONTROL;
+};
 
 typedef u32 RT_RF_CHANGE_SOURCE;
 #define RF_CHANGE_BY_SW		BIT(31)

drivers/staging/rtl8192u/ieee80211/ieee80211.h struct ieee80211_device { · line 1881

Quoted 5 lines
drivers/staging/rtl8192u/ieee80211/ieee80211.h +1 -1
@@ -1878,7 +1878,7 @@ struct ieee80211_device {
 	//added by amy for AP roaming
 	RT_LINK_DETECT_T	LinkDetectInfo;
 	//added by amy for ps
-	RT_POWER_SAVE_CONTROL	PowerSaveControl;
+	struct rt_power_save_control	PowerSaveControl;

The fields atr floating all over the place in this structure. Just put one space between the type and the field name.

julia

Quoted 13 lines
drivers/staging/rtl8192u/ieee80211/ieee80211.h +0 -1
 //}
 	/* used if IEEE_SOFTMAC_TX_QUEUE is set */
 	struct  tx_pending tx_pending;
--

2.17.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20190310174635.16923-4-bhanusreemahesh%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#6 lore raw

PATCH v2 4/5 Staging: rtl8192u: Remove typedef for struct _RT_LINK_DETECT_T

In reply to Bhanusree Pola

-Avoid typedefs for structure types to maintain kernel coding style.
-Remove typedefs RT_LINK_DETECT_T and *PRT_LINK_DETECT_T of struct _RT_LINK_DETECT_T. -Change Structure name _RT_LINK_DETECT_T to rt_link_detect to maintain Linux kernel Coding Style. -Replace occurences of RT_LINK_DETECT_T to struct rt_link_detect.

---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211.h +3 -3
index 152854fc09f8..6986b51b37c4 100644
@@ -1586,7 +1586,7 @@ typedef enum {
 } country_code_type_t;
 
 #define RT_MAX_LD_SLOT_NUM	10
-typedef struct _RT_LINK_DETECT_T {
+struct rt_link_detect {
 
 	u32				NumRecvBcnInPeriod;
 	u32				NumRecvDataInPeriod;
@@ -1599,7 +1599,7 @@ typedef struct _RT_LINK_DETECT_T {
 	u32				NumTxOkInPeriod;
 	u32				NumRxOkInPeriod;
 	bool				bBusyTraffic;
-} RT_LINK_DETECT_T, *PRT_LINK_DETECT_T;
+};
 
 
 struct ieee80211_device {
@@ -1876,7 +1876,7 @@ struct ieee80211_device {
 	bool FwRWRF;
 
 	//added by amy for AP roaming
-	RT_LINK_DETECT_T	LinkDetectInfo;
+	struct rt_link_detect	LinkDetectInfo;
 	//added by amy for ps
 	struct rt_power_save_control	PowerSaveControl;
 //}
Signature · 1 line
2.17.1
#7 lore raw

Re: [Outreachy kernel] [PATCH v2 4/5] Staging: rtl8192u: Remove typedef for struct _RT_LINK_DETECT_T

Review

Quoted 4 lines · Bhanusree Pola
(quoted diff) +0 -4
-Avoid typedefs for structure types to maintain kernel coding style.
-Remove typedefs RT_LINK_DETECT_T and *PRT_LINK_DETECT_T of struct _RT_LINK_DETECT_T.
-Change Structure name _RT_LINK_DETECT_T to rt_link_detect to maintain Linux kernel Coding Style.
-Replace occurences of RT_LINK_DETECT_T to struct rt_link_detect.

I think you could drop the -s

Quoted 47 lines
---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211.h +3 -4
index 152854fc09f8..6986b51b37c4 100644
@@ -1586,7 +1586,7 @@ typedef enum {
 } country_code_type_t;
 
 #define RT_MAX_LD_SLOT_NUM	10
-typedef struct _RT_LINK_DETECT_T {
+struct rt_link_detect {
 
 	u32				NumRecvBcnInPeriod;
 	u32				NumRecvDataInPeriod;
@@ -1599,7 +1599,7 @@ typedef struct _RT_LINK_DETECT_T {
 	u32				NumTxOkInPeriod;
 	u32				NumRxOkInPeriod;
 	bool				bBusyTraffic;
-} RT_LINK_DETECT_T, *PRT_LINK_DETECT_T;
+};
 
 
 struct ieee80211_device {
@@ -1876,7 +1876,7 @@ struct ieee80211_device {
 	bool FwRWRF;
 
 	//added by amy for AP roaming
-	RT_LINK_DETECT_T	LinkDetectInfo;
+	struct rt_link_detect	LinkDetectInfo;
 	//added by amy for ps
 	struct rt_power_save_control	PowerSaveControl;
 //}
--

2.17.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20190310174635.16923-5-bhanusreemahesh%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#8 lore raw

PATCH v2 5/5 Staging: rtl8192u: Remove typedef for struct _RX_REORDER_ENTRY

In reply to Bhanusree Pola

-Avoid typedefs for structure types to maintain kernel coding style.
-Remove typedefs RX_REORDER_ENTRY and *PRX_REORDER_ENTRY of struct _RX_REORDER_ENTRY . -Change Structure name _RX_REORDER_ENTRY to rx_reorder_entry to maintain Linux kernel Coding Style. -Replace occurences of RX_REORDER_ENTRY to struct rx_reorder_entry.
-Replace occurences of PRX_REORDER_ENTRY to struct rx_reorder_entry *.

---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h      |  6 +++---
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c   | 12 ++++++------
 drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 10 +++++-----
 3 files changed, 14 insertions(+), 14 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211.h +3 -3
index 6986b51b37c4..b19b0cf01e1f 100644
@@ -1474,11 +1474,11 @@ struct bandwidth_autoswitch {
 
 #define REORDER_WIN_SIZE	128
 #define REORDER_ENTRY_NUM	128
-typedef struct _RX_REORDER_ENTRY {
+struct rx_reorder_entry {
 	struct list_head	List;
 	u16			SeqNum;
 	struct ieee80211_rxb *prxb;
-} RX_REORDER_ENTRY, *PRX_REORDER_ENTRY;
+};
 //added by amy for order
 typedef enum _Fsync_State {
 	Default_Fsync,
@@ -1654,7 +1654,7 @@ struct ieee80211_device {
 	struct list_head		Rx_TS_Unused_List;
 	struct rx_ts_record		RxTsRecord[TOTAL_TS_NUM];
 //#ifdef TO_DO_LIST
-	RX_REORDER_ENTRY	RxReorderEntry[128];
+	struct rx_reorder_entry		RxReorderEntry[128];
 	struct list_head		RxReorder_Unused_List;
 //#endif
 	// Qos related. Added by Annie, 2005-11-01.
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +6 -6
index 5147f7c01e31..17d50476bdb2 100644
@@ -508,16 +508,16 @@ static int is_duplicate_packet(struct ieee80211_device *ieee,
 	return 1;
 }
 
-static bool AddReorderEntry(struct rx_ts_record *pTS, PRX_REORDER_ENTRY pReorderEntry)
+static bool AddReorderEntry(struct rx_ts_record *pTS, struct rx_reorder_entry *pReorderEntry)
 {
 	struct list_head *pList = &pTS->rx_pending_pkt_list;
 	while(pList->next != &pTS->rx_pending_pkt_list)
 	{
-		if( SN_LESS(pReorderEntry->SeqNum, ((PRX_REORDER_ENTRY)list_entry(pList->next,RX_REORDER_ENTRY,List))->SeqNum) )
+		if( SN_LESS(pReorderEntry->SeqNum, ((struct rx_reorder_entry *)list_entry(pList->next, struct rx_reorder_entry, List))->SeqNum) )
 		{
 			pList = pList->next;
 		}
-		else if( SN_EQUAL(pReorderEntry->SeqNum, ((PRX_REORDER_ENTRY)list_entry(pList->next,RX_REORDER_ENTRY,List))->SeqNum) )
+		else if( SN_EQUAL(pReorderEntry->SeqNum, ((struct rx_reorder_entry *)list_entry(pList->next, struct rx_reorder_entry, List))->SeqNum) )
 		{
 			return false;
 		}
@@ -589,7 +589,7 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee,
 				    struct rx_ts_record *pTS, u16 SeqNum)
 {
 	PRT_HIGH_THROUGHPUT	pHTInfo = ieee->pHTInfo;
-	PRX_REORDER_ENTRY	pReorderEntry = NULL;
+	struct rx_reorder_entry	*pReorderEntry = NULL;
 	struct ieee80211_rxb **prxbIndicateArray;
 	u8			WinSize = pHTInfo->RxReorderWinSize;
 	u16			WinEnd = (pTS->rx_indicate_seq + WinSize - 1) % 4096;
@@ -663,7 +663,7 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee,
 		/* Current packet is going to be inserted into pending list.*/
 		//IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): We RX no ordered packed, insert to ordered list\n",__func__);
 		if(!list_empty(&ieee->RxReorder_Unused_List)) {
-			pReorderEntry = (PRX_REORDER_ENTRY)list_entry(ieee->RxReorder_Unused_List.next,RX_REORDER_ENTRY,List);
+			pReorderEntry = (struct rx_reorder_entry *)list_entry(ieee->RxReorder_Unused_List.next, struct rx_reorder_entry, List);
 			list_del_init(&pReorderEntry->List);
 
 			/* Make a reorder entry and insert into a the packet list.*/
@@ -709,7 +709,7 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee,
 	/* Check if there is any packet need indicate.*/
 	while(!list_empty(&pTS->rx_pending_pkt_list)) {
 		IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): start RREORDER indicate\n",__func__);
-		pReorderEntry = (PRX_REORDER_ENTRY)list_entry(pTS->rx_pending_pkt_list.prev,RX_REORDER_ENTRY,List);
+		pReorderEntry = (struct rx_reorder_entry *)list_entry(pTS->rx_pending_pkt_list.prev, struct rx_reorder_entry, List);
 		if (SN_LESS(pReorderEntry->SeqNum, pTS->rx_indicate_seq) ||
 		    SN_EQUAL(pReorderEntry->SeqNum, pTS->rx_indicate_seq))
 		{
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c +5 -5
index c76715ffa08b..aefa37b285b3 100644
@@ -28,7 +28,7 @@ static void RxPktPendingTimeout(struct timer_list *t)
 	struct rx_ts_record     *pRxTs = from_timer(pRxTs, t, rx_pkt_pending_timer);
 	struct ieee80211_device *ieee = container_of(pRxTs, struct ieee80211_device, RxTsRecord[pRxTs->num]);
 
-	PRX_REORDER_ENTRY	pReorderEntry = NULL;
+	struct rx_reorder_entry	*pReorderEntry = NULL;
 
 	//u32 flags = 0;
 	unsigned long flags = 0;
@@ -40,7 +40,7 @@ static void RxPktPendingTimeout(struct timer_list *t)
 	if(pRxTs->rx_timeout_indicate_seq != 0xffff) {
 		// Indicate the pending packets sequentially according to SeqNum until meet the gap.
 		while(!list_empty(&pRxTs->rx_pending_pkt_list)) {
-			pReorderEntry = (PRX_REORDER_ENTRY)list_entry(pRxTs->rx_pending_pkt_list.prev, RX_REORDER_ENTRY, List);
+			pReorderEntry = (struct rx_reorder_entry *)list_entry(pRxTs->rx_pending_pkt_list.prev, struct rx_reorder_entry, List);
 			if(index == 0)
 				pRxTs->rx_indicate_seq = pReorderEntry->SeqNum;
 
@@ -133,7 +133,7 @@ void TSInitialize(struct ieee80211_device *ieee)
 {
 	struct tx_ts_record     *pTxTS  = ieee->TxTsRecord;
 	struct rx_ts_record     *pRxTS  = ieee->RxTsRecord;
-	PRX_REORDER_ENTRY	pRxReorderEntry = ieee->RxReorderEntry;
+	struct rx_reorder_entry	*pRxReorderEntry = ieee->RxReorderEntry;
 	u8				count = 0;
 	IEEE80211_DEBUG(IEEE80211_DL_TS, "==========>%s()\n", __func__);
 	// Initialize Tx TS related info.
@@ -418,7 +418,7 @@ static void RemoveTsEntry(struct ieee80211_device *ieee, struct ts_common_info *
 
 	if(TxRxSelect == RX_DIR) {
 //#ifdef TO_DO_LIST
-		PRX_REORDER_ENTRY	pRxReorderEntry;
+		struct rx_reorder_entry	*pRxReorderEntry;
 		struct rx_ts_record     *pRxTS = (struct rx_ts_record *)pTs;
 		if(timer_pending(&pRxTS->rx_pkt_pending_timer))
 			del_timer_sync(&pRxTS->rx_pkt_pending_timer);
@@ -426,7 +426,7 @@ static void RemoveTsEntry(struct ieee80211_device *ieee, struct ts_common_info *
 		while(!list_empty(&pRxTS->rx_pending_pkt_list)) {
 			spin_lock_irqsave(&(ieee->reorder_spinlock), flags);
 			//pRxReorderEntry = list_entry(&pRxTS->rx_pending_pkt_list.prev,RX_REORDER_ENTRY,List);
-			pRxReorderEntry = (PRX_REORDER_ENTRY)list_entry(pRxTS->rx_pending_pkt_list.prev, RX_REORDER_ENTRY, List);
+			pRxReorderEntry = (struct rx_reorder_entry *)list_entry(pRxTS->rx_pending_pkt_list.prev, struct rx_reorder_entry, List);
 			list_del_init(&pRxReorderEntry->List);
 			{
 				int i = 0;
Signature · 1 line
2.17.1
#9 lore raw

Re: [Outreachy kernel] [PATCH v2 5/5] Staging: rtl8192u: Remove typedef for struct _RX_REORDER_ENTRY

Quoted 74 lines · Bhanusree Pola
(quoted diff) +0 -5
-Avoid typedefs for structure types to maintain kernel coding style.
-Remove typedefs RX_REORDER_ENTRY  and *PRX_REORDER_ENTRY  of struct _RX_REORDER_ENTRY .
-Change Structure name _RX_REORDER_ENTRY  to rx_reorder_entry to maintain Linux kernel Coding Style.
-Replace occurences of RX_REORDER_ENTRY  to struct rx_reorder_entry.
-Replace occurences of PRX_REORDER_ENTRY  to struct rx_reorder_entry *.
---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h      |  6 +++---
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c   | 12 ++++++------
 drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 10 +++++-----
 3 files changed, 14 insertions(+), 14 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211.h +3 -3
index 6986b51b37c4..b19b0cf01e1f 100644
@@ -1474,11 +1474,11 @@ struct bandwidth_autoswitch {
 
 #define REORDER_WIN_SIZE	128
 #define REORDER_ENTRY_NUM	128
-typedef struct _RX_REORDER_ENTRY {
+struct rx_reorder_entry {
 	struct list_head	List;
 	u16			SeqNum;
 	struct ieee80211_rxb *prxb;
-} RX_REORDER_ENTRY, *PRX_REORDER_ENTRY;
+};
 //added by amy for order
 typedef enum _Fsync_State {
 	Default_Fsync,
@@ -1654,7 +1654,7 @@ struct ieee80211_device {
 	struct list_head		Rx_TS_Unused_List;
 	struct rx_ts_record		RxTsRecord[TOTAL_TS_NUM];
 //#ifdef TO_DO_LIST
-	RX_REORDER_ENTRY	RxReorderEntry[128];
+	struct rx_reorder_entry		RxReorderEntry[128];
 	struct list_head		RxReorder_Unused_List;
 //#endif
 	// Qos related. Added by Annie, 2005-11-01.
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +4 -4
index 5147f7c01e31..17d50476bdb2 100644
@@ -508,16 +508,16 @@ static int is_duplicate_packet(struct ieee80211_device *ieee,
 	return 1;
 }
 
-static bool AddReorderEntry(struct rx_ts_record *pTS, PRX_REORDER_ENTRY pReorderEntry)
+static bool AddReorderEntry(struct rx_ts_record *pTS, struct rx_reorder_entry *pReorderEntry)
 {
 	struct list_head *pList = &pTS->rx_pending_pkt_list;
 	while(pList->next != &pTS->rx_pending_pkt_list)
 	{
-		if( SN_LESS(pReorderEntry->SeqNum, ((PRX_REORDER_ENTRY)list_entry(pList->next,RX_REORDER_ENTRY,List))->SeqNum) )
+		if( SN_LESS(pReorderEntry->SeqNum, ((struct rx_reorder_entry *)list_entry(pList->next, struct rx_reorder_entry, List))->SeqNum) )
 		{
 			pList = pList->next;
 		}
-		else if( SN_EQUAL(pReorderEntry->SeqNum, ((PRX_REORDER_ENTRY)list_entry(pList->next,RX_REORDER_ENTRY,List))->SeqNum) )
+		else if( SN_EQUAL(pReorderEntry->SeqNum, ((struct rx_reorder_entry *)list_entry(pList->next, struct rx_reorder_entry, List))->SeqNum) )
 		{
 			return false;
 		}
@@ -589,7 +589,7 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee,
 				    struct rx_ts_record *pTS, u16 SeqNum)
 {
 	PRT_HIGH_THROUGHPUT	pHTInfo = ieee->pHTInfo;
-	PRX_REORDER_ENTRY	pReorderEntry = NULL;
+	struct rx_reorder_entry	*pReorderEntry = NULL;
 	struct ieee80211_rxb **prxbIndicateArray;
 	u8			WinSize = pHTInfo->RxReorderWinSize;
 	u16			WinEnd = (pTS->rx_indicate_seq + WinSize - 1) % 4096;

drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c static void RxReorderIndicatePacket(struct ieee80211_device *ieee, · line 666

Quoted 5 lines
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +1 -1
@@ -663,7 +663,7 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee,
 		/* Current packet is going to be inserted into pending list.*/
 		//IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): We RX no ordered packed, insert to ordered list\n",__func__);
 		if(!list_empty(&ieee->RxReorder_Unused_List)) {
-			pReorderEntry = (PRX_REORDER_ENTRY)list_entry(ieee->RxReorder_Unused_List.next,RX_REORDER_ENTRY,List);
+			pReorderEntry = (struct rx_reorder_entry *)list_entry(ieee->RxReorder_Unused_List.next, struct rx_reorder_entry, List);

You have made the 80 character problems worse. But you are in luck, because the casts on the return values of list_entry are useless. list_entry is a macro and already casts its return value to the type mentioned in its second argument.

This could be an extra patch in the series. In that patch, for the ifs that are above, you could also adjust the spacing around the if and the condition expression to follow the kernel guidelines.

The patches are now much more readable with only one typedef at a time :)

julia

Quoted 71 lines
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +1 -1
 			list_del_init(&pReorderEntry->List);
 
 			/* Make a reorder entry and insert into a the packet list.*/
@@ -709,7 +709,7 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee,
 	/* Check if there is any packet need indicate.*/
 	while(!list_empty(&pTS->rx_pending_pkt_list)) {
 		IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): start RREORDER indicate\n",__func__);
-		pReorderEntry = (PRX_REORDER_ENTRY)list_entry(pTS->rx_pending_pkt_list.prev,RX_REORDER_ENTRY,List);
+		pReorderEntry = (struct rx_reorder_entry *)list_entry(pTS->rx_pending_pkt_list.prev, struct rx_reorder_entry, List);
 		if (SN_LESS(pReorderEntry->SeqNum, pTS->rx_indicate_seq) ||
 		    SN_EQUAL(pReorderEntry->SeqNum, pTS->rx_indicate_seq))
 		{
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c +5 -6
index c76715ffa08b..aefa37b285b3 100644
@@ -28,7 +28,7 @@ static void RxPktPendingTimeout(struct timer_list *t)
 	struct rx_ts_record     *pRxTs = from_timer(pRxTs, t, rx_pkt_pending_timer);
 	struct ieee80211_device *ieee = container_of(pRxTs, struct ieee80211_device, RxTsRecord[pRxTs->num]);
 
-	PRX_REORDER_ENTRY	pReorderEntry = NULL;
+	struct rx_reorder_entry	*pReorderEntry = NULL;
 
 	//u32 flags = 0;
 	unsigned long flags = 0;
@@ -40,7 +40,7 @@ static void RxPktPendingTimeout(struct timer_list *t)
 	if(pRxTs->rx_timeout_indicate_seq != 0xffff) {
 		// Indicate the pending packets sequentially according to SeqNum until meet the gap.
 		while(!list_empty(&pRxTs->rx_pending_pkt_list)) {
-			pReorderEntry = (PRX_REORDER_ENTRY)list_entry(pRxTs->rx_pending_pkt_list.prev, RX_REORDER_ENTRY, List);
+			pReorderEntry = (struct rx_reorder_entry *)list_entry(pRxTs->rx_pending_pkt_list.prev, struct rx_reorder_entry, List);
 			if(index == 0)
 				pRxTs->rx_indicate_seq = pReorderEntry->SeqNum;
 
@@ -133,7 +133,7 @@ void TSInitialize(struct ieee80211_device *ieee)
 {
 	struct tx_ts_record     *pTxTS  = ieee->TxTsRecord;
 	struct rx_ts_record     *pRxTS  = ieee->RxTsRecord;
-	PRX_REORDER_ENTRY	pRxReorderEntry = ieee->RxReorderEntry;
+	struct rx_reorder_entry	*pRxReorderEntry = ieee->RxReorderEntry;
 	u8				count = 0;
 	IEEE80211_DEBUG(IEEE80211_DL_TS, "==========>%s()\n", __func__);
 	// Initialize Tx TS related info.
@@ -418,7 +418,7 @@ static void RemoveTsEntry(struct ieee80211_device *ieee, struct ts_common_info *
 
 	if(TxRxSelect == RX_DIR) {
 //#ifdef TO_DO_LIST
-		PRX_REORDER_ENTRY	pRxReorderEntry;
+		struct rx_reorder_entry	*pRxReorderEntry;
 		struct rx_ts_record     *pRxTS = (struct rx_ts_record *)pTs;
 		if(timer_pending(&pRxTS->rx_pkt_pending_timer))
 			del_timer_sync(&pRxTS->rx_pkt_pending_timer);
@@ -426,7 +426,7 @@ static void RemoveTsEntry(struct ieee80211_device *ieee, struct ts_common_info *
 		while(!list_empty(&pRxTS->rx_pending_pkt_list)) {
 			spin_lock_irqsave(&(ieee->reorder_spinlock), flags);
 			//pRxReorderEntry = list_entry(&pRxTS->rx_pending_pkt_list.prev,RX_REORDER_ENTRY,List);
-			pRxReorderEntry = (PRX_REORDER_ENTRY)list_entry(pRxTS->rx_pending_pkt_list.prev, RX_REORDER_ENTRY, List);
+			pRxReorderEntry = (struct rx_reorder_entry *)list_entry(pRxTS->rx_pending_pkt_list.prev, struct rx_reorder_entry, List);
 			list_del_init(&pRxReorderEntry->List);
 			{
 				int i = 0;
--

2.17.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20190310174635.16923-6-bhanusreemahesh%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#10 lore raw

Re: [Outreachy kernel] [PATCH v2 5/5] Staging: rtl8192u: Remove typedef for struct _RX_REORDER_ENTRY

Quoted 84 lines · Julia Lawall
Quoted 81 lines · Bhanusree Pola
(quoted diff) +0 -5
-Avoid typedefs for structure types to maintain kernel coding style.
-Remove typedefs RX_REORDER_ENTRY  and *PRX_REORDER_ENTRY  of struct _RX_REORDER_ENTRY .
-Change Structure name _RX_REORDER_ENTRY  to rx_reorder_entry to maintain Linux kernel Coding Style.
-Replace occurences of RX_REORDER_ENTRY  to struct rx_reorder_entry.
-Replace occurences of PRX_REORDER_ENTRY  to struct rx_reorder_entry *.

---

drivers/staging/rtl8192u/ieee80211/ieee80211.h      |  6 +++---
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c   | 12 ++++++------
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 10 +++++-----
3 files changed, 14 insertions(+), 14 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211.h +3 -3
index 6986b51b37c4..b19b0cf01e1f 100644
@@ -1474,11 +1474,11 @@ struct bandwidth_autoswitch {
 
 #define REORDER_WIN_SIZE    128
 #define REORDER_ENTRY_NUM    128
-typedef struct _RX_REORDER_ENTRY {
+struct rx_reorder_entry {
   struct list_head    List;
   u16            SeqNum;
   struct ieee80211_rxb *prxb;
-} RX_REORDER_ENTRY, *PRX_REORDER_ENTRY;
+};
 //added by amy for order
 typedef enum _Fsync_State {
   Default_Fsync,
@@ -1654,7 +1654,7 @@ struct ieee80211_device {
   struct list_head        Rx_TS_Unused_List;
   struct rx_ts_record        RxTsRecord[TOTAL_TS_NUM];
 //#ifdef TO_DO_LIST
-    RX_REORDER_ENTRY    RxReorderEntry[128];
+    struct rx_reorder_entry        RxReorderEntry[128];
   struct list_head        RxReorder_Unused_List;
 //#endif
   // Qos related. Added by Annie, 2005-11-01.
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +4 -4
index 5147f7c01e31..17d50476bdb2 100644
@@ -508,16 +508,16 @@ static int is_duplicate_packet(struct ieee80211_device *ieee,
   return 1;
 }
 
-static bool AddReorderEntry(struct rx_ts_record *pTS, PRX_REORDER_ENTRY pReorderEntry)
+static bool AddReorderEntry(struct rx_ts_record *pTS, struct rx_reorder_entry *pReorderEntry)
 {
   struct list_head *pList = &pTS->rx_pending_pkt_list;
   while(pList->next != &pTS->rx_pending_pkt_list)
   {
-        if( SN_LESS(pReorderEntry->SeqNum, ((PRX_REORDER_ENTRY)list_entry(pList->next,RX_REORDER_ENTRY,List))->SeqNum) )
+        if( SN_LESS(pReorderEntry->SeqNum, ((struct rx_reorder_entry *)list_entry(pList->next, struct rx_reorder_entry, List))->SeqNum) )
       {
           pList = pList->next;
       }
-        else if( SN_EQUAL(pReorderEntry->SeqNum, ((PRX_REORDER_ENTRY)list_entry(pList->next,RX_REORDER_ENTRY,List))->SeqNum) )
+        else if( SN_EQUAL(pReorderEntry->SeqNum, ((struct rx_reorder_entry *)list_entry(pList->next, struct rx_reorder_entry, List))->SeqNum) )
       {
           return false;
       }
@@ -589,7 +589,7 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee,
                   struct rx_ts_record *pTS, u16 SeqNum)
 {
   PRT_HIGH_THROUGHPUT    pHTInfo = ieee->pHTInfo;
-    PRX_REORDER_ENTRY    pReorderEntry = NULL;
+    struct rx_reorder_entry    *pReorderEntry = NULL;
   struct ieee80211_rxb **prxbIndicateArray;
   u8            WinSize = pHTInfo->RxReorderWinSize;
   u16            WinEnd = (pTS->rx_indicate_seq + WinSize - 1) % 4096;
@@ -663,7 +663,7 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee,
       /* Current packet is going to be inserted into pending list.*/
       //IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): We RX no ordered packed, insert to ordered list\n",__func__);
Quoted 8 lines

drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c static void RxReorderIndicatePacket(struct ieee80211_device *ieee, · line 666

Quoted 3 lines
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +1 -1
       if(!list_empty(&ieee->RxReorder_Unused_List)) {
-            pReorderEntry = (PRX_REORDER_ENTRY)list_entry(ieee->RxReorder_Unused_List.next,RX_REORDER_ENTRY,List);
+            pReorderEntry = (struct rx_reorder_entry *)list_entry(ieee->RxReorder_Unused_List.next, struct rx_reorder_entry, List);

You have made the 80 character problems worse. But you are in luck, because the casts on the return values of list_entry are useless. list_entry is a macro and already casts its return value to the type mentioned in its second argument.

Should I remove the typecast of return value ?
This must be done in the same patch right ?

Quoted 4 lines

This could be an extra patch in the series. In that patch, for the ifs that are above, you could also adjust the spacing around the if and the condition expression to follow the kernel guidelines.

Only this exclusively would be an extra patch ?

Quoted 77 lines

The patches are now much more readable with only one typedef at a time :)

julia

Quoted 71 lines
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +1 -1
           list_del_init(&pReorderEntry->List);
 
           /* Make a reorder entry and insert into a the packet list.*/
@@ -709,7 +709,7 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee,
   /* Check if there is any packet need indicate.*/
   while(!list_empty(&pTS->rx_pending_pkt_list)) {
       IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): start RREORDER indicate\n",__func__);
-        pReorderEntry = (PRX_REORDER_ENTRY)list_entry(pTS->rx_pending_pkt_list.prev,RX_REORDER_ENTRY,List);
+        pReorderEntry = (struct rx_reorder_entry *)list_entry(pTS->rx_pending_pkt_list.prev, struct rx_reorder_entry, List);
       if (SN_LESS(pReorderEntry->SeqNum, pTS->rx_indicate_seq) ||
           SN_EQUAL(pReorderEntry->SeqNum, pTS->rx_indicate_seq))
       {
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c +5 -6
index c76715ffa08b..aefa37b285b3 100644
@@ -28,7 +28,7 @@ static void RxPktPendingTimeout(struct timer_list *t)
   struct rx_ts_record     *pRxTs = from_timer(pRxTs, t, rx_pkt_pending_timer);
   struct ieee80211_device *ieee = container_of(pRxTs, struct ieee80211_device, RxTsRecord[pRxTs->num]);
 
-    PRX_REORDER_ENTRY    pReorderEntry = NULL;
+    struct rx_reorder_entry    *pReorderEntry = NULL;
 
   //u32 flags = 0;
   unsigned long flags = 0;
@@ -40,7 +40,7 @@ static void RxPktPendingTimeout(struct timer_list *t)
   if(pRxTs->rx_timeout_indicate_seq != 0xffff) {
       // Indicate the pending packets sequentially according to SeqNum until meet the gap.
       while(!list_empty(&pRxTs->rx_pending_pkt_list)) {
-            pReorderEntry = (PRX_REORDER_ENTRY)list_entry(pRxTs->rx_pending_pkt_list.prev, RX_REORDER_ENTRY, List);
+            pReorderEntry = (struct rx_reorder_entry *)list_entry(pRxTs->rx_pending_pkt_list.prev, struct rx_reorder_entry, List);
           if(index == 0)
               pRxTs->rx_indicate_seq = pReorderEntry->SeqNum;
 
@@ -133,7 +133,7 @@ void TSInitialize(struct ieee80211_device *ieee)
 {
   struct tx_ts_record     *pTxTS  = ieee->TxTsRecord;
   struct rx_ts_record     *pRxTS  = ieee->RxTsRecord;
-    PRX_REORDER_ENTRY    pRxReorderEntry = ieee->RxReorderEntry;
+    struct rx_reorder_entry    *pRxReorderEntry = ieee->RxReorderEntry;
   u8                count = 0;
   IEEE80211_DEBUG(IEEE80211_DL_TS, "==========>%s()\n", __func__);
   // Initialize Tx TS related info.
@@ -418,7 +418,7 @@ static void RemoveTsEntry(struct ieee80211_device *ieee, struct ts_common_info *
 
   if(TxRxSelect == RX_DIR) {
 //#ifdef TO_DO_LIST
-        PRX_REORDER_ENTRY    pRxReorderEntry;
+        struct rx_reorder_entry    *pRxReorderEntry;
       struct rx_ts_record     *pRxTS = (struct rx_ts_record *)pTs;
       if(timer_pending(&pRxTS->rx_pkt_pending_timer))
           del_timer_sync(&pRxTS->rx_pkt_pending_timer);
@@ -426,7 +426,7 @@ static void RemoveTsEntry(struct ieee80211_device *ieee, struct ts_common_info *
       while(!list_empty(&pRxTS->rx_pending_pkt_list)) {
           spin_lock_irqsave(&(ieee->reorder_spinlock), flags);
           //pRxReorderEntry = list_entry(&pRxTS->rx_pending_pkt_list.prev,RX_REORDER_ENTRY,List);
-            pRxReorderEntry = (PRX_REORDER_ENTRY)list_entry(pRxTS->rx_pending_pkt_list.prev, RX_REORDER_ENTRY, List);
+            pRxReorderEntry = (struct rx_reorder_entry *)list_entry(pRxTS->rx_pending_pkt_list.prev, struct rx_reorder_entry, List);
           list_del_init(&pRxReorderEntry->List);
           {
               int i = 0;
--

2.17.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20190310174635.16923-6-bhanusreemahesh%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#11 lore raw

Re: [Outreachy kernel] [PATCH v2 5/5] Staging: rtl8192u: Remove typedef for struct _RX_REORDER_ENTRY

Quoted 92 lines · Bhanusree Mahesh
Quoted 84 lines · Julia Lawall
Quoted 81 lines · Bhanusree Pola
(quoted diff) +0 -5
-Avoid typedefs for structure types to maintain kernel coding style.
-Remove typedefs RX_REORDER_ENTRY  and *PRX_REORDER_ENTRY  of struct _RX_REORDER_ENTRY .
-Change Structure name _RX_REORDER_ENTRY  to rx_reorder_entry to maintain Linux kernel Coding Style.
-Replace occurences of RX_REORDER_ENTRY  to struct rx_reorder_entry.
-Replace occurences of PRX_REORDER_ENTRY  to struct rx_reorder_entry *.

---

drivers/staging/rtl8192u/ieee80211/ieee80211.h      |  6 +++---
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c   | 12 ++++++------
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 10 +++++-----
3 files changed, 14 insertions(+), 14 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211.h +3 -3
index 6986b51b37c4..b19b0cf01e1f 100644
@@ -1474,11 +1474,11 @@ struct bandwidth_autoswitch {
 
 #define REORDER_WIN_SIZE    128
 #define REORDER_ENTRY_NUM    128
-typedef struct _RX_REORDER_ENTRY {
+struct rx_reorder_entry {
   struct list_head    List;
   u16            SeqNum;
   struct ieee80211_rxb *prxb;
-} RX_REORDER_ENTRY, *PRX_REORDER_ENTRY;
+};
 //added by amy for order
 typedef enum _Fsync_State {
   Default_Fsync,
@@ -1654,7 +1654,7 @@ struct ieee80211_device {
   struct list_head        Rx_TS_Unused_List;
   struct rx_ts_record        RxTsRecord[TOTAL_TS_NUM];
 //#ifdef TO_DO_LIST
-    RX_REORDER_ENTRY    RxReorderEntry[128];
+    struct rx_reorder_entry        RxReorderEntry[128];
   struct list_head        RxReorder_Unused_List;
 //#endif
   // Qos related. Added by Annie, 2005-11-01.
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +4 -4
index 5147f7c01e31..17d50476bdb2 100644
@@ -508,16 +508,16 @@ static int is_duplicate_packet(struct ieee80211_device *ieee,
   return 1;
 }
 
-static bool AddReorderEntry(struct rx_ts_record *pTS, PRX_REORDER_ENTRY pReorderEntry)
+static bool AddReorderEntry(struct rx_ts_record *pTS, struct rx_reorder_entry *pReorderEntry)
 {
   struct list_head *pList = &pTS->rx_pending_pkt_list;
   while(pList->next != &pTS->rx_pending_pkt_list)
   {
-        if( SN_LESS(pReorderEntry->SeqNum, ((PRX_REORDER_ENTRY)list_entry(pList->next,RX_REORDER_ENTRY,List))->SeqNum) )
+        if( SN_LESS(pReorderEntry->SeqNum, ((struct rx_reorder_entry *)list_entry(pList->next, struct rx_reorder_entry, List))->SeqNum) )
       {
           pList = pList->next;
       }
-        else if( SN_EQUAL(pReorderEntry->SeqNum, ((PRX_REORDER_ENTRY)list_entry(pList->next,RX_REORDER_ENTRY,List))->SeqNum) )
+        else if( SN_EQUAL(pReorderEntry->SeqNum, ((struct rx_reorder_entry *)list_entry(pList->next, struct rx_reorder_entry, List))->SeqNum) )
       {
           return false;
       }
@@ -589,7 +589,7 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee,
                   struct rx_ts_record *pTS, u16 SeqNum)
 {
   PRT_HIGH_THROUGHPUT    pHTInfo = ieee->pHTInfo;
-    PRX_REORDER_ENTRY    pReorderEntry = NULL;
+    struct rx_reorder_entry    *pReorderEntry = NULL;
   struct ieee80211_rxb **prxbIndicateArray;
   u8            WinSize = pHTInfo->RxReorderWinSize;
   u16            WinEnd = (pTS->rx_indicate_seq + WinSize - 1) % 4096;
@@ -663,7 +663,7 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee,
       /* Current packet is going to be inserted into pending list.*/
       //IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): We RX no ordered packed, insert to ordered list\n",__func__);
Quoted 8 lines

drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c static void RxReorderIndicatePacket(struct ieee80211_device *ieee, · line 666

Quoted 3 lines
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +1 -1
       if(!list_empty(&ieee->RxReorder_Unused_List)) {
-            pReorderEntry = (PRX_REORDER_ENTRY)list_entry(ieee->RxReorder_Unused_List.next,RX_REORDER_ENTRY,List);
+            pReorderEntry = (struct rx_reorder_entry *)list_entry(ieee->RxReorder_Unused_List.next, struct rx_reorder_entry, List);

You have made the 80 character problems worse. But you are in luck, because the casts on the return values of list_entry are useless. list_entry is a macro and already casts its return value to the type mentioned in its second argument.

Quoted 2 lines

Should I remove the typecast of return value ?
This must be done in the same patch right ?

No it doesn't have to be done in the same patch. Casting a value that is already casted takes up extra space, but doesn't pose any compilation problem. Since the change is different than removing typedefs, it would be better to make a separate patch, but still part of the same series, since it depends on the other patches (same file and same affected lines).

Quoted 5 lines
Quoted 4 lines

This could be an extra patch in the series. In that patch, for the ifs that are above, you could also adjust the spacing around the if and the condition expression to follow the kernel guidelines.

Only this exclusively would be an extra patch ?

One extra patch for all of the list_entry issues. If a line affected by a list_entry issue also has some glaring whitespace issues, you can also fix them up. I guess these whitespace issues on ifs would occur everywhere in the file. If you want to fix them all up, it could indeed be yet another patch in the series.

julia

Quoted 78 lines
Quoted 77 lines

The patches are now much more readable with only one typedef at a time :)

julia

Quoted 71 lines
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +1 -1
           list_del_init(&pReorderEntry->List);
 
           /* Make a reorder entry and insert into a the packet list.*/
@@ -709,7 +709,7 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee,
   /* Check if there is any packet need indicate.*/
   while(!list_empty(&pTS->rx_pending_pkt_list)) {
       IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): start RREORDER indicate\n",__func__);
-        pReorderEntry = (PRX_REORDER_ENTRY)list_entry(pTS->rx_pending_pkt_list.prev,RX_REORDER_ENTRY,List);
+        pReorderEntry = (struct rx_reorder_entry *)list_entry(pTS->rx_pending_pkt_list.prev, struct rx_reorder_entry, List);
       if (SN_LESS(pReorderEntry->SeqNum, pTS->rx_indicate_seq) ||
           SN_EQUAL(pReorderEntry->SeqNum, pTS->rx_indicate_seq))
       {
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c +5 -6
index c76715ffa08b..aefa37b285b3 100644
@@ -28,7 +28,7 @@ static void RxPktPendingTimeout(struct timer_list *t)
   struct rx_ts_record     *pRxTs = from_timer(pRxTs, t, rx_pkt_pending_timer);
   struct ieee80211_device *ieee = container_of(pRxTs, struct ieee80211_device, RxTsRecord[pRxTs->num]);
 
-    PRX_REORDER_ENTRY    pReorderEntry = NULL;
+    struct rx_reorder_entry    *pReorderEntry = NULL;
 
   //u32 flags = 0;
   unsigned long flags = 0;
@@ -40,7 +40,7 @@ static void RxPktPendingTimeout(struct timer_list *t)
   if(pRxTs->rx_timeout_indicate_seq != 0xffff) {
       // Indicate the pending packets sequentially according to SeqNum until meet the gap.
       while(!list_empty(&pRxTs->rx_pending_pkt_list)) {
-            pReorderEntry = (PRX_REORDER_ENTRY)list_entry(pRxTs->rx_pending_pkt_list.prev, RX_REORDER_ENTRY, List);
+            pReorderEntry = (struct rx_reorder_entry *)list_entry(pRxTs->rx_pending_pkt_list.prev, struct rx_reorder_entry, List);
           if(index == 0)
               pRxTs->rx_indicate_seq = pReorderEntry->SeqNum;
 
@@ -133,7 +133,7 @@ void TSInitialize(struct ieee80211_device *ieee)
 {
   struct tx_ts_record     *pTxTS  = ieee->TxTsRecord;
   struct rx_ts_record     *pRxTS  = ieee->RxTsRecord;
-    PRX_REORDER_ENTRY    pRxReorderEntry = ieee->RxReorderEntry;
+    struct rx_reorder_entry    *pRxReorderEntry = ieee->RxReorderEntry;
   u8                count = 0;
   IEEE80211_DEBUG(IEEE80211_DL_TS, "==========>%s()\n", __func__);
   // Initialize Tx TS related info.
@@ -418,7 +418,7 @@ static void RemoveTsEntry(struct ieee80211_device *ieee, struct ts_common_info *
 
   if(TxRxSelect == RX_DIR) {
 //#ifdef TO_DO_LIST
-        PRX_REORDER_ENTRY    pRxReorderEntry;
+        struct rx_reorder_entry    *pRxReorderEntry;
       struct rx_ts_record     *pRxTS = (struct rx_ts_record *)pTs;
       if(timer_pending(&pRxTS->rx_pkt_pending_timer))
           del_timer_sync(&pRxTS->rx_pkt_pending_timer);
@@ -426,7 +426,7 @@ static void RemoveTsEntry(struct ieee80211_device *ieee, struct ts_common_info *
       while(!list_empty(&pRxTS->rx_pending_pkt_list)) {
           spin_lock_irqsave(&(ieee->reorder_spinlock), flags);
           //pRxReorderEntry = list_entry(&pRxTS->rx_pending_pkt_list.prev,RX_REORDER_ENTRY,List);
-            pRxReorderEntry = (PRX_REORDER_ENTRY)list_entry(pRxTS->rx_pending_pkt_list.prev, RX_REORDER_ENTRY, List);
+            pRxReorderEntry = (struct rx_reorder_entry *)list_entry(pRxTS->rx_pending_pkt_list.prev, struct rx_reorder_entry, List);
           list_del_init(&pRxReorderEntry->List);
           {
               int i = 0;
--

2.17.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20190310174635.16923-6-bhanusreemahesh%40gmail.com.
For more options, visit https://groups.google.com/d/optout.