Staging: rtl8192e: Use list_first_entry instead of list_entry
PATCH 1/1 Staging: rtl8192e: Use list_first_entry instead of list_entry
This patch replaces list_entry with list_first_entry as it makes the code more clear.
Done using coccinelle:
@@
expression e;
@@
(
- list_entry(e->next,
+ list_first_entry(e,
...)
|
- list_entry(e->prev,
+ list_last_entry(e,
...)
)
--- drivers/staging/rtl8192e/rtl819x_TSProc.c | 2 +- drivers/staging/rtl8192e/rtllib_rx.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8192e/rtl819x_TSProc.c +1 -1
@@ -371,7 +371,7 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS, ((TxRxSelect ==TX_DIR ) ?DIR_UP :DIR_DOWN );if (!list_empty (pUnusedList)) { - (*ppTS) =list_entry (pUnusedList->next, + (*ppTS) =list_first_entry (pUnusedList, struct ts_common_info, List);list_del_init (&(*ppTS)->List);if (TxRxSelect ==TX_DIR ) {
drivers/staging/rtl8192e/rtllib_rx.c +2 -2
@@ -461,11 +461,11 @@ static bool AddReorderEntry(struct rx_ts_record *pTS,while (pList->next != &pTS->RxPendingPktList) {if (SN_LESS (pReorderEntry->SeqNum, ((struct rx_reorder_entry *) - list_entry(pList->next, struct rx_reorder_entry, + list_first_entry(pList, 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_first_entry (pList, struct rx_reorder_entry, List))->SeqNum))return false;else
Signature · 1 line
1.9.1
Quoted 41 lines · Bhumika Goyal
This patch replaces
list_entrywithlist_first_entryas it makes the code more clear.
Done using coccinelle:@@
expression e;
@@
(
- list_entry(e->next,
+ list_first_entry(e,
...)
|
- list_entry(e->prev,
+ list_last_entry(e,
...)
)Signed-off-by Bhumika Goyal <[email protected]>--- drivers/staging/rtl8192e/rtl819x_TSProc.c | 2 +- drivers/staging/rtl8192e/rtllib_rx.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)drivers/staging/rtl8192e/rtl819x_TSProc.c +1
-1@@ -371,7 +371,7 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS, ((TxRxSelect ==TX_DIR ) ?DIR_UP :DIR_DOWN );if (!list_empty (pUnusedList)) { - (*ppTS) =list_entry (pUnusedList->next, + (*ppTS) =list_first_entry (pUnusedList, struct ts_common_info, List);list_del_init (&(*ppTS)->List);if (TxRxSelect ==TX_DIR ) {drivers/staging/rtl8192e/rtllib_rx.c +0
-0
drivers/staging/rtl8192e/rtllib_rx.c static bool AddReorderEntry(struct rx_ts_record *pTS, · line 462
Quoted 2 lines
drivers/staging/rtl8192e/rtllib_rx.c +0
-0@@ -461,11 +461,11 @@ static bool AddReorderEntry(struct rx_ts_record *pTS,while (pList->next != &pTS->RxPendingPktList) {
Is this a list_for_each in disguise?
julia
Quoted 21 lines
drivers/staging/rtl8192e/rtllib_rx.c +2
-3if (SN_LESS (pReorderEntry->SeqNum, ((struct rx_reorder_entry *) - list_entry(pList->next, struct rx_reorder_entry, + list_first_entry(pList, 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_first_entry (pList, struct rx_reorder_entry, List))->SeqNum))return false;else --1.9.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/1457278585-16295-1-git-send-email-bhumirks%40gmail.com.
For more options, visit https://groups.google.com/d/optout.