Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S944923AbcJSP0H (ORCPT ); Wed, 19 Oct 2016 11:26:07 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:34275 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S944091AbcJSPFx (ORCPT ); Wed, 19 Oct 2016 11:05:53 -0400 From: Ivan Safonov To: Greg Kroah-Hartman , Bhaktipriya Shridhar , Andy Shevchenko , Geliang Tang , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Cc: insafonov@gmail.com Subject: [PATCH 31/37] staging:r8188eu: remove pscanned member of mlme_priv structure Date: Wed, 19 Oct 2016 22:07:59 +0700 Message-Id: <1476889685-7367-31-git-send-email-insafonov@gmail.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1476889685-7367-1-git-send-email-insafonov@gmail.com> References: <1476889685-7367-1-git-send-email-insafonov@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5066 Lines: 130 This member used only as local variable. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 2 -- drivers/staging/rtl8188eu/core/rtw_mlme.c | 11 +++++------ drivers/staging/rtl8188eu/include/rtw_mlme.h | 1 - drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 19 +++++++++++-------- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c index 67508a6..9d4472a 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c @@ -40,8 +40,6 @@ u8 rtw_do_join(struct adapter *padapter) set_fwstate(pmlmepriv, _FW_UNDER_LINKING); - pmlmepriv->pscanned = plist; - pmlmepriv->to_join = true; if (list_empty(&queue->queue)) { diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c index 249e004..1322688 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c @@ -42,8 +42,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; pmlmepriv->scan_mode = SCAN_ACTIVE;/* 1: active, 0: pasive. Maybe someday we should rename this varable to "active_mode" (Jeff) */ @@ -1504,19 +1502,20 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv) struct wlan_network *pnetwork = NULL; struct wlan_network *candidate = NULL; u8 supp_ant_div = false; + struct list_head *scanned; spin_lock_bh(&(pmlmepriv->scanned_queue.lock)); phead = get_list_head(queue); adapter = (struct adapter *)pmlmepriv->nic_hdl; - pmlmepriv->pscanned = phead->next; - while (phead != pmlmepriv->pscanned) { - pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list); + scanned = phead->next; + while (phead != scanned) { + pnetwork = container_of(scanned, struct wlan_network, list); if (pnetwork == NULL) { RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("%s return _FAIL:(pnetwork==NULL)\n", __func__)); ret = _FAIL; goto exit; } - pmlmepriv->pscanned = pmlmepriv->pscanned->next; + scanned = scanned->next; rtw_check_join_candidate(pmlmepriv, &candidate, pnetwork); } if (candidate == NULL) { diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme.h b/drivers/staging/rtl8188eu/include/rtw_mlme.h index a30448a..e1e46ce 100644 --- a/drivers/staging/rtl8188eu/include/rtw_mlme.h +++ b/drivers/staging/rtl8188eu/include/rtw_mlme.h @@ -293,7 +293,6 @@ struct mlme_priv { u8 *nic_hdl; - struct list_head *pscanned; struct __queue free_bss_pool; struct __queue scanned_queue; u8 *free_bss_buf; diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c index 6364a05..2a81796 100644 --- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c @@ -966,6 +966,7 @@ static int rtw_wx_set_wap(struct net_device *dev, struct __queue *queue = &(pmlmepriv->scanned_queue); struct wlan_network *pnetwork = NULL; enum ndis_802_11_auth_mode authmode; + struct list_head *scanned; if (_FAIL == rtw_pwr_wakeup(padapter)) { ret = -1; @@ -985,12 +986,12 @@ static int rtw_wx_set_wap(struct net_device *dev, authmode = padapter->securitypriv.ndisauthtype; spin_lock_bh(&queue->lock); phead = get_list_head(queue); - pmlmepriv->pscanned = phead->next; + scanned = phead->next; - while (phead != pmlmepriv->pscanned) { - pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list); + while (phead != scanned) { + pnetwork = container_of(scanned, struct wlan_network, list); - pmlmepriv->pscanned = pmlmepriv->pscanned->next; + scanned = scanned->next; dst_bssid = pnetwork->network.MacAddress; @@ -1313,6 +1314,8 @@ static int rtw_wx_set_essid(struct net_device *dev, authmode = padapter->securitypriv.ndisauthtype; DBG_88E("=>%s\n", __func__); if (wrqu->essid.flags && wrqu->essid.length) { + struct list_head *scanned; + len = min_t(uint, wrqu->essid.length, IW_ESSID_MAX_SIZE); if (wrqu->essid.length != 33) @@ -1326,12 +1329,12 @@ static int rtw_wx_set_essid(struct net_device *dev, RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_, ("rtw_wx_set_essid: ssid =[%s]\n", src_ssid)); spin_lock_bh(&queue->lock); phead = get_list_head(queue); - pmlmepriv->pscanned = phead->next; + scanned = phead->next; - while (phead != pmlmepriv->pscanned) { - pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list); + while (phead != scanned) { + pnetwork = container_of(scanned, struct wlan_network, list); - pmlmepriv->pscanned = pmlmepriv->pscanned->next; + scanned = scanned->next; dst_ssid = pnetwork->network.Ssid.Ssid; -- 2.7.3