[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <c5612ce863fb1094f102c04f6bbbd85a7f55edd1.1506755265.git.srishtishar@gmail.com>
Date: Sat, 30 Sep 2017 12:50:12 +0530
From: Srishti Sharma <srishtishar@...il.com>
To: gregkh@...uxfoundation.org
Cc: devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
outreachy-kernel@...glegroups.com,
Srishti Sharma <srishtishar@...il.com>
Subject: [PATCH 3/6] Staging: rtl8188eu: core: Use list_entry instead of container_of
For variables of the type struct list_head* use list_entry to access
current list element instead of using container_of.
Done using the following semantic patch by coccinelle.
@r@
struct list_head* l;
@@
-container_of
+list_entry
(l,...)
Signed-off-by: Srishti Sharma <srishtishar@...il.com>
---
drivers/staging/rtl8188eu/core/rtw_mlme.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c
index f663e6c..71b1f8a 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c
@@ -198,7 +198,7 @@ struct wlan_network *rtw_find_network(struct __queue *scanned_queue, u8 *addr)
plist = phead->next;
while (plist != phead) {
- pnetwork = container_of(plist, struct wlan_network, list);
+ pnetwork = list_entry(plist, struct wlan_network, list);
if (!memcmp(addr, pnetwork->network.MacAddress, ETH_ALEN))
break;
plist = plist->next;
@@ -223,7 +223,7 @@ void rtw_free_network_queue(struct adapter *padapter, u8 isfreeall)
plist = phead->next;
while (phead != plist) {
- pnetwork = container_of(plist, struct wlan_network, list);
+ pnetwork = list_entry(plist, struct wlan_network, list);
plist = plist->next;
@@ -342,7 +342,7 @@ struct wlan_network *rtw_get_oldest_wlan_network(struct __queue *scanned_queue)
phead = get_list_head(scanned_queue);
for (plist = phead->next; plist != phead; plist = plist->next) {
- pwlan = container_of(plist, struct wlan_network, list);
+ pwlan = list_entry(plist, struct wlan_network, list);
if (!pwlan->fixed) {
if (!oldest || time_after(oldest->last_scanned, pwlan->last_scanned))
@@ -421,7 +421,7 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t
plist = phead->next;
while (phead != plist) {
- pnetwork = container_of(plist, struct wlan_network, list);
+ pnetwork = list_entry(plist, struct wlan_network, list);
if (is_same_network(&(pnetwork->network), target))
break;
--
2.7.4
Powered by blists - more mailing lists