Skip to content

Commit

Permalink
staging: rtl8188eu: remove nic_hdl from struct mlme_priv
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Martin Kaiser authored and Greg Kroah-Hartman committed May 10, 2021
1 parent 706321a commit edee771
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 1 addition & 4 deletions drivers/staging/rtl8188eu/core/rtw_mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ int rtw_init_mlme_priv(struct adapter *padapter)

/* We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */

pmlmepriv->nic_hdl = (u8 *)padapter;

pmlmepriv->pscanned = NULL;
pmlmepriv->fw_state = 0;
pmlmepriv->cur_network.network.InfrastructureMode = Ndis802_11AutoUnknown;
Expand Down Expand Up @@ -1446,15 +1444,14 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv)
{
int ret;
struct list_head *phead;
struct adapter *adapter;
struct adapter *adapter = container_of(pmlmepriv, struct adapter, mlmepriv);
struct __queue *queue = &pmlmepriv->scanned_queue;
struct wlan_network *pnetwork = NULL;
struct wlan_network *candidate = NULL;
u8 supp_ant_div = false;

spin_lock_bh(&pmlmepriv->scanned_queue.lock);
phead = get_list_head(queue);
adapter = (struct adapter *)pmlmepriv->nic_hdl;
list_for_each(pmlmepriv->pscanned, phead) {
pnetwork = list_entry(pmlmepriv->pscanned,
struct wlan_network, list);
Expand Down
2 changes: 0 additions & 2 deletions drivers/staging/rtl8188eu/include/rtw_mlme.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ struct mlme_priv {
u8 to_join; /* flag */
u8 to_roaming; /* roaming trying times */

u8 *nic_hdl;

struct list_head *pscanned;
struct __queue free_bss_pool;
struct __queue scanned_queue;
Expand Down

0 comments on commit edee771

Please sign in to comment.