All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Staging: rtl8192u: Remove typedef struct types
@ 2019-03-10 16:05 Bhanusree Pola
  2019-03-10 16:05 ` [PATCH 1/2] Staging: rtl8192u: Avoid typedefs for structure types Bhanusree Pola
  2019-03-10 16:05 ` [PATCH 2/2] Staging: rtl8192: Remove occurances of typedef struct datatypes Bhanusree Pola
  0 siblings, 2 replies; 5+ messages in thread
From: Bhanusree Pola @ 2019-03-10 16:05 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Greg Kroah-Hartman

This patch series removes typedefs for various structures to maintain
Linux KernelCoding style.
Using typedefs for structures is discouraged.

Bhanusree Pola (2):
  Staging: rtl8192u: Avoid typedefs for structure types
  Staging: rtl8192: Remove occurances of typedef struct datatypes

 .../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(-)

-- 
2.17.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] Staging: rtl8192u: Avoid typedefs for structure types
  2019-03-10 16:05 [PATCH 0/2] Staging: rtl8192u: Remove typedef struct types Bhanusree Pola
@ 2019-03-10 16:05 ` Bhanusree Pola
  2019-03-10 16:05 ` [PATCH 2/2] Staging: rtl8192: Remove occurances of typedef struct datatypes Bhanusree Pola
  1 sibling, 0 replies; 5+ messages in thread
From: Bhanusree Pola @ 2019-03-10 16:05 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Greg Kroah-Hartman

Remove typedef for structure type variables to maintain Kernel coding style.
Remove all occurances of typedef for various structures in ieeee802111
module.

Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com>
---
 .../staging/rtl8192u/ieee80211/ieee80211.h    | 20 +++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
index 8aa536d79900..b1036d522640 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
@@ -1462,23 +1462,23 @@ 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
 
 #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,
@@ -1506,9 +1506,9 @@ typedef enum _RT_JOIN_ACTION {
 	RT_NO_ACTION  = 4,
 } RT_JOIN_ACTION;
 
-typedef struct _IbssParms {
+struct _IbssParms {
 	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.
@@ -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)
@@ -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_T {
 
 	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 {
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] Staging: rtl8192: Remove occurances of typedef struct datatypes
  2019-03-10 16:05 [PATCH 0/2] Staging: rtl8192u: Remove typedef struct types Bhanusree Pola
  2019-03-10 16:05 ` [PATCH 1/2] Staging: rtl8192u: Avoid typedefs for structure types Bhanusree Pola
@ 2019-03-10 16:05 ` Bhanusree Pola
  2019-03-10 16:12   ` [Outreachy kernel] " Julia Lawall
  1 sibling, 1 reply; 5+ messages in thread
From: Bhanusree Pola @ 2019-03-10 16:05 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Greg Kroah-Hartman

Remove all occurances of typedef struct type datatypes.
Replace all occurances of IbssParms with struct _IbssParms
Replace all occurances of RX_REORDER_ENTRY with struct _RX_REORDER_ENTRY
Replace all occurances of bandwidth_autoswitch with struct _bandwidth_autoswitch
Replace all occurances of RT_LINK_DETECT_T with struct _RT_LINK_DETECT_T
Replace all occurances of RT_POWER_SAVE_CONTROL with struct _RT_POWER_SAVE_CONTROL
Replace all occurances of PRX_REORDER_ENTRY with struct _RX_REORDER_ENTRY *

Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h      | 10 +++++-----
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c   | 12 ++++++------
 drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 10 +++++-----
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
index b1036d522640..092ae4621e04 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
@@ -1554,7 +1554,7 @@ struct _RT_POWER_SAVE_CONTROL {
 	struct octet_string			tmpSuppRateSet;
 	u8					tmpSuppRateBuf[MAX_NUM_RATES];
 	bool				bTmpSuppRate;
-	IbssParms				tmpIbpm;
+	struct _IbssParms				tmpIbpm;
 	bool				bTmpIbpm;
 
 	//
@@ -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.
@@ -1871,14 +1871,14 @@ 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;
 
 	//added by amy for AP roaming
-	RT_LINK_DETECT_T	LinkDetectInfo;
+	struct _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;
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index 5147f7c01e31..fe5a716ae3e7 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -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))
 		{
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
index c76715ffa08b..7e3740f16399 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
@@ -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



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Outreachy kernel] [PATCH 2/2] Staging: rtl8192: Remove occurances of typedef struct datatypes
  2019-03-10 16:05 ` [PATCH 2/2] Staging: rtl8192: Remove occurances of typedef struct datatypes Bhanusree Pola
@ 2019-03-10 16:12   ` Julia Lawall
  2019-03-10 16:18     ` Bhanusree Mahesh
  0 siblings, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2019-03-10 16:12 UTC (permalink / raw)
  To: Bhanusree Pola; +Cc: outreachy-kernel, Greg Kroah-Hartman



On Sun, 10 Mar 2019, Bhanusree Pola wrote:

> Remove all occurances of typedef struct type datatypes.
> Replace all occurances of IbssParms with struct _IbssParms
> Replace all occurances of RX_REORDER_ENTRY with struct _RX_REORDER_ENTRY
> Replace all occurances of bandwidth_autoswitch with struct _bandwidth_autoswitch
> Replace all occurances of RT_LINK_DETECT_T with struct _RT_LINK_DETECT_T
> Replace all occurances of RT_POWER_SAVE_CONTROL with struct _RT_POWER_SAVE_CONTROL
> Replace all occurances of PRX_REORDER_ENTRY with struct _RX_REORDER_ENTRY *

You need to respect the principle that the kernel should compile at all
times.  So if you remove a typedef, then you should update the uses in the
same patch.

Also, you should choose struct names that correspond to the Linux kernel
coding style.  So, no underscores in front of names, no _T at the end of
the name, and no camel case or names in all capital letters (except for
macros).

The patches will be much easier to review if you make a series with one
patch per structure.

julia

>
> Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com>
> ---
>  drivers/staging/rtl8192u/ieee80211/ieee80211.h      | 10 +++++-----
>  drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c   | 12 ++++++------
>  drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 10 +++++-----
>  3 files changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
> index b1036d522640..092ae4621e04 100644
> --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
> +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
> @@ -1554,7 +1554,7 @@ struct _RT_POWER_SAVE_CONTROL {
>  	struct octet_string			tmpSuppRateSet;
>  	u8					tmpSuppRateBuf[MAX_NUM_RATES];
>  	bool				bTmpSuppRate;
> -	IbssParms				tmpIbpm;
> +	struct _IbssParms				tmpIbpm;
>  	bool				bTmpIbpm;
>
>  	//
> @@ -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.
> @@ -1871,14 +1871,14 @@ 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;
>
>  	//added by amy for AP roaming
> -	RT_LINK_DETECT_T	LinkDetectInfo;
> +	struct _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;
> diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
> index 5147f7c01e31..fe5a716ae3e7 100644
> --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
> +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
> @@ -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))
>  		{
> diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
> index c76715ffa08b..7e3740f16399 100644
> --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
> +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
> @@ -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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20190310160554.4479-3-bhanusreemahesh%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Outreachy kernel] [PATCH 2/2] Staging: rtl8192: Remove occurances of typedef struct datatypes
  2019-03-10 16:12   ` [Outreachy kernel] " Julia Lawall
@ 2019-03-10 16:18     ` Bhanusree Mahesh
  0 siblings, 0 replies; 5+ messages in thread
From: Bhanusree Mahesh @ 2019-03-10 16:18 UTC (permalink / raw)
  To: Julia Lawall; +Cc: outreachy-kernel, Greg Kroah-Hartman

On Sun, 10 Mar 2019 at 21:42, Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>
>
> On Sun, 10 Mar 2019, Bhanusree Pola wrote:
>
> > Remove all occurances of typedef struct type datatypes.
> > Replace all occurances of IbssParms with struct _IbssParms
> > Replace all occurances of RX_REORDER_ENTRY with struct _RX_REORDER_ENTRY
> > Replace all occurances of bandwidth_autoswitch with struct _bandwidth_autoswitch
> > Replace all occurances of RT_LINK_DETECT_T with struct _RT_LINK_DETECT_T
> > Replace all occurances of RT_POWER_SAVE_CONTROL with struct _RT_POWER_SAVE_CONTROL
> > Replace all occurances of PRX_REORDER_ENTRY with struct _RX_REORDER_ENTRY *
>
> You need to respect the principle that the kernel should compile at all
> times.  So if you remove a typedef, then you should update the uses in the
> same patch.
Thanks for the quick reply :) . i was really confused on how to make
the series on this.
>
> Also, you should choose struct names that correspond to the Linux kernel
> coding style.  So, no underscores in front of names, no _T at the end of
> the name, and no camel case or names in all capital letters (except for
> macros).
I will follow that.
>
> The patches will be much easier to review if you make a series with one
> patch per structure.
Sure.
>
> julia
>
> >
> > Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com>
> > ---
> >  drivers/staging/rtl8192u/ieee80211/ieee80211.h      | 10 +++++-----
> >  drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c   | 12 ++++++------
> >  drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 10 +++++-----
> >  3 files changed, 16 insertions(+), 16 deletions(-)
> >
> > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
> > index b1036d522640..092ae4621e04 100644
> > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
> > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
> > @@ -1554,7 +1554,7 @@ struct _RT_POWER_SAVE_CONTROL {
> >       struct octet_string                     tmpSuppRateSet;
> >       u8                                      tmpSuppRateBuf[MAX_NUM_RATES];
> >       bool                            bTmpSuppRate;
> > -     IbssParms                               tmpIbpm;
> > +     struct _IbssParms                               tmpIbpm;
> >       bool                            bTmpIbpm;
> >
> >       //
> > @@ -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.
> > @@ -1871,14 +1871,14 @@ 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;
> >
> >       //added by amy for AP roaming
> > -     RT_LINK_DETECT_T        LinkDetectInfo;
> > +     struct _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;
> > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
> > index 5147f7c01e31..fe5a716ae3e7 100644
> > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
> > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
> > @@ -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))
> >               {
> > diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
> > index c76715ffa08b..7e3740f16399 100644
> > --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
> > +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
> > @@ -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 outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20190310160554.4479-3-bhanusreemahesh%40gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
>
> --
> 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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/alpine.DEB.2.21.1903101709320.3131%40hadrien.
> For more options, visit https://groups.google.com/d/optout.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-03-10 16:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-10 16:05 [PATCH 0/2] Staging: rtl8192u: Remove typedef struct types Bhanusree Pola
2019-03-10 16:05 ` [PATCH 1/2] Staging: rtl8192u: Avoid typedefs for structure types Bhanusree Pola
2019-03-10 16:05 ` [PATCH 2/2] Staging: rtl8192: Remove occurances of typedef struct datatypes Bhanusree Pola
2019-03-10 16:12   ` [Outreachy kernel] " Julia Lawall
2019-03-10 16:18     ` Bhanusree Mahesh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.