staging: rtl8192u: Remove casts on the return values of list_entry
authorBhanusree Pola <bhanusreemahesh@gmail.com>
Mon, 11 Mar 2019 15:41:40 +0000 (21:11 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 Mar 2019 06:05:23 +0000 (07:05 +0100)
Remove casts return values of on all occurances of list_entry.
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.

Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c

index c2483da..52c655b 100644 (file)
@@ -513,11 +513,11 @@ static bool AddReorderEntry(struct rx_ts_record *pTS, struct rx_reorder_entry *p
        struct list_head *pList = &pTS->rx_pending_pkt_list;
        while(pList->next != &pTS->rx_pending_pkt_list)
        {
-               if( SN_LESS(pReorderEntry->SeqNum, ((struct rx_reorder_entry *)list_entry(pList->next, struct rx_reorder_entry, List))->SeqNum) )
+               if( SN_LESS(pReorderEntry->SeqNum, list_entry(pList->next, struct rx_reorder_entry, List)->SeqNum) )
                {
                        pList = pList->next;
                }
-               else if( SN_EQUAL(pReorderEntry->SeqNum, ((struct rx_reorder_entry *)list_entry(pList->next, struct rx_reorder_entry, List))->SeqNum) )
+               else if( SN_EQUAL(pReorderEntry->SeqNum, list_entry(pList->next, struct rx_reorder_entry, List)->SeqNum) )
                {
                        return false;
                }
@@ -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 = (struct rx_reorder_entry *)list_entry(ieee->RxReorder_Unused_List.next, struct rx_reorder_entry, List);
+                       pReorderEntry = 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 = (struct rx_reorder_entry *)list_entry(pTS->rx_pending_pkt_list.prev, struct rx_reorder_entry, List);
+               pReorderEntry = 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))
                {
index aefa37b..0368e5e 100644 (file)
@@ -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 = (struct rx_reorder_entry *)list_entry(pRxTs->rx_pending_pkt_list.prev, struct rx_reorder_entry, List);
+                       pReorderEntry = list_entry(pRxTs->rx_pending_pkt_list.prev, struct rx_reorder_entry, List);
                        if(index == 0)
                                pRxTs->rx_indicate_seq = pReorderEntry->SeqNum;
 
@@ -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 = (struct rx_reorder_entry *)list_entry(pRxTS->rx_pending_pkt_list.prev, struct rx_reorder_entry, List);
+                       pRxReorderEntry = list_entry(pRxTS->rx_pending_pkt_list.prev, struct rx_reorder_entry, List);
                        list_del_init(&pRxReorderEntry->List);
                        {
                                int i = 0;