Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: rtl8188eu: remove nic_hdl from struct mlme_priv

struct mlme_priv is an element of struct adapter. Use container_of
to get a pointer to the enclosing struct.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210506121410.17613-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Martin Kaiser and committed by
Greg Kroah-Hartman
edee771a 706321a5

+1 -6
+1 -4
drivers/staging/rtl8188eu/core/rtw_mlme.c
··· 32 32 33 33 /* We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */ 34 34 35 - pmlmepriv->nic_hdl = (u8 *)padapter; 36 - 37 35 pmlmepriv->pscanned = NULL; 38 36 pmlmepriv->fw_state = 0; 39 37 pmlmepriv->cur_network.network.InfrastructureMode = Ndis802_11AutoUnknown; ··· 1444 1446 { 1445 1447 int ret; 1446 1448 struct list_head *phead; 1447 - struct adapter *adapter; 1449 + struct adapter *adapter = container_of(pmlmepriv, struct adapter, mlmepriv); 1448 1450 struct __queue *queue = &pmlmepriv->scanned_queue; 1449 1451 struct wlan_network *pnetwork = NULL; 1450 1452 struct wlan_network *candidate = NULL; ··· 1452 1454 1453 1455 spin_lock_bh(&pmlmepriv->scanned_queue.lock); 1454 1456 phead = get_list_head(queue); 1455 - adapter = (struct adapter *)pmlmepriv->nic_hdl; 1456 1457 list_for_each(pmlmepriv->pscanned, phead) { 1457 1458 pnetwork = list_entry(pmlmepriv->pscanned, 1458 1459 struct wlan_network, list);
-2
drivers/staging/rtl8188eu/include/rtw_mlme.h
··· 111 111 u8 to_join; /* flag */ 112 112 u8 to_roaming; /* roaming trying times */ 113 113 114 - u8 *nic_hdl; 115 - 116 114 struct list_head *pscanned; 117 115 struct __queue free_bss_pool; 118 116 struct __queue scanned_queue;