From 51e1f13a918e4c4acc3e2550947f05ade5332949 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Thu, 5 Aug 2021 13:37:15 -0500 Subject: [PATCH] Remove all calls to _rtw_spinlock_free() This routine is empty, thus all calls to it can be removed. Link: https://lore.kernel.org/r/20210805183717.23007-4-Larry.Finger@lwfinger.net --- core/mesh/rtw_mesh.c | 4 +--- core/mesh/rtw_mesh_pathtbl.c | 1 - core/rtw_ap.c | 5 ----- core/rtw_cmd.c | 1 - core/rtw_mlme.c | 3 --- core/rtw_recv.c | 10 --------- core/rtw_sta_mgt.c | 39 ----------------------------------- core/rtw_tdls.c | 2 -- core/rtw_wlan_util.c | 5 ----- core/rtw_xmit.c | 25 ---------------------- hal/hal_com.c | 6 +----- hal/hal_intf.c | 1 - hal/rtl8192e/rtl8192e_dm.c | 1 - include/osdep_service.h | 1 - include/rtw_mlme_ext.h | 1 - os_dep/linux/ioctl_cfg80211.c | 3 --- os_dep/linux/os_intfs.c | 18 ---------------- os_dep/osdep_service.c | 14 ------------- 18 files changed, 2 insertions(+), 138 deletions(-) diff --git a/core/mesh/rtw_mesh.c b/core/mesh/rtw_mesh.c index c0099d8..8fe498c 100644 --- a/core/mesh/rtw_mesh.c +++ b/core/mesh/rtw_mesh.c @@ -1165,7 +1165,7 @@ void dump_mesh_networks(void *sel, _adapter *adapter) ); } - rtw_vmfree(mesh_networks, mlme->max_bss_cnt * sizeof(struct wlan_network *)); + vfree(mesh_networks); } void rtw_mesh_adjust_chbw(u8 req_ch, u8 *req_bw, u8 *req_offset) @@ -2284,8 +2284,6 @@ void rtw_mesh_plink_ctl_deinit(_adapter *adapter) } _exit_critical_bh(&(plink_ctl->lock), &irqL); - _rtw_spinlock_free(&plink_ctl->lock); - #if CONFIG_RTW_MESH_PEER_BLACKLIST rtw_mesh_peer_blacklist_flush(adapter); _rtw_deinit_queue(&plink_ctl->peer_blacklist); diff --git a/core/mesh/rtw_mesh_pathtbl.c b/core/mesh/rtw_mesh_pathtbl.c index 49c3af4..4f09940 100644 --- a/core/mesh/rtw_mesh_pathtbl.c +++ b/core/mesh/rtw_mesh_pathtbl.c @@ -741,7 +741,6 @@ static void rtw_mesh_path_free_rcu(struct rtw_mesh_table *tbl, _cancel_timer_ex(&mpath->timer); atomic_dec(&adapter->mesh_info.mpaths); atomic_dec(&tbl->entries); - _rtw_spinlock_free(&mpath->state_lock); rtw_mesh_path_flush_pending(mpath); diff --git a/core/rtw_ap.c b/core/rtw_ap.c index 34a86fd..01fecc8 100644 --- a/core/rtw_ap.c +++ b/core/rtw_ap.c @@ -38,7 +38,6 @@ void free_mlme_ap_info(_adapter *padapter) struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); stop_ap_mode(padapter); - _rtw_spinlock_free(&pmlmepriv->bcn_update_lock); } @@ -2560,9 +2559,6 @@ static void _rtw_macaddr_acl_deinit(_adapter *adapter, u8 period, bool clear_onl } _exit_critical_bh(&(acl_node_q->lock), &irqL); - if (!clear_only) - _rtw_spinlock_free(&(acl_node_q->lock)); - rtw_warn_on(acl->num); acl->mode = RTW_ACL_MODE_DISABLED; } @@ -4223,7 +4219,6 @@ void stop_ap_mode(_adapter *padapter) pmlmepriv->update_bcn = _FALSE; /*pmlmeext->bstart_bss = _FALSE;*/ padapter->netif_up = _FALSE; - /* _rtw_spinlock_free(&pmlmepriv->bcn_update_lock); */ /* reset and init security priv , this can refine with rtw_reset_securitypriv */ _rtw_memset((unsigned char *)&padapter->securitypriv, 0, sizeof(struct security_priv)); diff --git a/core/rtw_cmd.c b/core/rtw_cmd.c index 03bcedb..aa96e87 100644 --- a/core/rtw_cmd.c +++ b/core/rtw_cmd.c @@ -224,7 +224,6 @@ void _rtw_free_cmd_priv(struct cmd_priv *pcmdpriv) { if (pcmdpriv) { - _rtw_spinlock_free(&(pcmdpriv->cmd_queue.lock)); _rtw_free_sema(&(pcmdpriv->cmd_queue_sema)); /* _rtw_free_sema(&(pcmdpriv->cmd_done_sema)); */ _rtw_free_sema(&(pcmdpriv->start_cmdthread_sema)); diff --git a/core/rtw_mlme.c b/core/rtw_mlme.c index 1588e49..5262391 100644 --- a/core/rtw_mlme.c +++ b/core/rtw_mlme.c @@ -152,9 +152,6 @@ exit: void rtw_mfree_mlme_priv_lock(struct mlme_priv *pmlmepriv); void rtw_mfree_mlme_priv_lock(struct mlme_priv *pmlmepriv) { - _rtw_spinlock_free(&pmlmepriv->lock); - _rtw_spinlock_free(&(pmlmepriv->free_bss_pool.lock)); - _rtw_spinlock_free(&(pmlmepriv->scanned_queue.lock)); } static void rtw_free_mlme_ie_data(u8 **ppie, u32 *plen) diff --git a/core/rtw_recv.c b/core/rtw_recv.c index 7443e0a..1b8577d 100644 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -168,19 +168,9 @@ exit: void rtw_mfree_recv_priv_lock(struct recv_priv *precvpriv); void rtw_mfree_recv_priv_lock(struct recv_priv *precvpriv) { - _rtw_spinlock_free(&precvpriv->lock); #ifdef CONFIG_RECV_THREAD_MODE _rtw_free_sema(&precvpriv->recv_sema); #endif - - _rtw_spinlock_free(&precvpriv->free_recv_queue.lock); - _rtw_spinlock_free(&precvpriv->recv_pending_queue.lock); - - _rtw_spinlock_free(&precvpriv->free_recv_buf_queue.lock); - -#ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX - _rtw_spinlock_free(&precvpriv->recv_buf_pending_queue.lock); -#endif /* CONFIG_USE_USB_BUFFER_ALLOC_RX */ } void _rtw_free_recv_priv(struct recv_priv *precvpriv) diff --git a/core/rtw_sta_mgt.c b/core/rtw_sta_mgt.c index 5d05dc1..96caae5 100644 --- a/core/rtw_sta_mgt.c +++ b/core/rtw_sta_mgt.c @@ -350,36 +350,10 @@ inline struct sta_info *rtw_get_stainfo_by_offset(struct sta_priv *stapriv, int return (struct sta_info *)(stapriv->pstainfo_buf + offset * sizeof(struct sta_info)); } -void _rtw_free_sta_xmit_priv_lock(struct sta_xmit_priv *psta_xmitpriv); -void _rtw_free_sta_xmit_priv_lock(struct sta_xmit_priv *psta_xmitpriv) -{ - - _rtw_spinlock_free(&psta_xmitpriv->lock); - - _rtw_spinlock_free(&(psta_xmitpriv->be_q.sta_pending.lock)); - _rtw_spinlock_free(&(psta_xmitpriv->bk_q.sta_pending.lock)); - _rtw_spinlock_free(&(psta_xmitpriv->vi_q.sta_pending.lock)); - _rtw_spinlock_free(&(psta_xmitpriv->vo_q.sta_pending.lock)); -} - -static void _rtw_free_sta_recv_priv_lock(struct sta_recv_priv *psta_recvpriv) -{ - - _rtw_spinlock_free(&psta_recvpriv->lock); - - _rtw_spinlock_free(&(psta_recvpriv->defrag_q.lock)); - - -} - void rtw_mfree_stainfo(struct sta_info *psta); void rtw_mfree_stainfo(struct sta_info *psta) { - if (&psta->lock != NULL) - _rtw_spinlock_free(&psta->lock); - - _rtw_free_sta_xmit_priv_lock(&psta->sta_xmitpriv); _rtw_free_sta_recv_priv_lock(&psta->sta_recvpriv); } @@ -416,17 +390,6 @@ void rtw_mfree_sta_priv_lock(struct sta_priv *pstapriv) { rtw_mfree_all_stainfo(pstapriv); /* be done before free sta_hash_lock */ - _rtw_spinlock_free(&pstapriv->free_sta_queue.lock); - - _rtw_spinlock_free(&pstapriv->sta_hash_lock); - _rtw_spinlock_free(&pstapriv->wakeup_q.lock); - _rtw_spinlock_free(&pstapriv->sleep_q.lock); - -#ifdef CONFIG_AP_MODE - _rtw_spinlock_free(&pstapriv->asoc_list_lock); - _rtw_spinlock_free(&pstapriv->auth_list_lock); -#endif - } u32 _rtw_free_sta_priv(struct sta_priv *pstapriv) @@ -822,7 +785,6 @@ u32 rtw_free_stainfo(_adapter *padapter , struct sta_info *psta) rtw_st_ctl_deinit(&psta->st_ctl); if (is_pre_link_sta == _FALSE) { - _rtw_spinlock_free(&psta->lock); /* _enter_critical_bh(&(pfree_sta_queue->lock), &irqL0); */ _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL0); @@ -1310,7 +1272,6 @@ void rtw_pre_link_sta_ctl_deinit(struct sta_priv *stapriv) rtw_pre_link_sta_ctl_reset(stapriv); - _rtw_spinlock_free(&pre_link_sta_ctl->lock); } void dump_pre_link_sta_ctl(void *sel, struct sta_priv *stapriv) diff --git a/core/rtw_tdls.c b/core/rtw_tdls.c index a06f616..caa8697 100644 --- a/core/rtw_tdls.c +++ b/core/rtw_tdls.c @@ -88,8 +88,6 @@ int rtw_init_tdls_info(_adapter *padapter) void rtw_free_tdls_info(struct tdls_info *ptdlsinfo) { - _rtw_spinlock_free(&ptdlsinfo->cmd_lock); - _rtw_spinlock_free(&ptdlsinfo->hdl_lock); _rtw_memset(ptdlsinfo, 0, sizeof(struct tdls_info)); diff --git a/core/rtw_wlan_util.c b/core/rtw_wlan_util.c index 97300c1..43f2b9a 100644 --- a/core/rtw_wlan_util.c +++ b/core/rtw_wlan_util.c @@ -4091,11 +4091,6 @@ inline void rtw_macid_ctl_init(struct macid_ctl_t *macid_ctl) _rtw_spinlock_init(&macid_ctl->lock); } -inline void rtw_macid_ctl_deinit(struct macid_ctl_t *macid_ctl) -{ - _rtw_spinlock_free(&macid_ctl->lock); -} - inline bool rtw_bmp_is_set(const u8 *bmp, u8 bmp_len, u8 id) { if (id / 8 >= bmp_len) diff --git a/core/rtw_xmit.c b/core/rtw_xmit.c index f88345d..4ab7066 100644 --- a/core/rtw_xmit.c +++ b/core/rtw_xmit.c @@ -62,12 +62,6 @@ void rtw_init_xmit_block(_adapter *padapter) dvobj->xmit_block = XMIT_BLOCK_NONE; } -void rtw_free_xmit_block(_adapter *padapter) -{ - struct dvobj_priv *dvobj = adapter_to_dvobj(padapter); - - _rtw_spinlock_free(&dvobj->xmit_block_lock); -} s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter) { @@ -360,21 +354,7 @@ exit: void rtw_mfree_xmit_priv_lock(struct xmit_priv *pxmitpriv); void rtw_mfree_xmit_priv_lock(struct xmit_priv *pxmitpriv) { - _rtw_spinlock_free(&pxmitpriv->lock); _rtw_free_sema(&pxmitpriv->xmit_sema); - - _rtw_spinlock_free(&pxmitpriv->be_pending.lock); - _rtw_spinlock_free(&pxmitpriv->bk_pending.lock); - _rtw_spinlock_free(&pxmitpriv->vi_pending.lock); - _rtw_spinlock_free(&pxmitpriv->vo_pending.lock); - _rtw_spinlock_free(&pxmitpriv->bm_pending.lock); - - /* _rtw_spinlock_free(&pxmitpriv->legacy_dz_queue.lock); */ - /* _rtw_spinlock_free(&pxmitpriv->apsd_queue.lock); */ - - _rtw_spinlock_free(&pxmitpriv->free_xmit_queue.lock); - _rtw_spinlock_free(&pxmitpriv->free_xmitbuf_queue.lock); - _rtw_spinlock_free(&pxmitpriv->pending_xmitbuf_queue.lock); } @@ -419,10 +399,6 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv) } vfree(pxmitpriv->xframe_ext_alloc_addr); - _rtw_spinlock_free(&pxmitpriv->free_xframe_ext_queue.lock); - - /* free xmit extension buff */ - _rtw_spinlock_free(&pxmitpriv->free_xmit_extbuf_queue.lock); pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf; for (i = 0; i < NR_XMIT_EXTBUFF; i++) { @@ -444,7 +420,6 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv) #ifdef CONFIG_XMIT_ACK _rtw_mutex_free(&pxmitpriv->ack_tx_mutex); #endif - rtw_free_xmit_block(padapter); out: return; } diff --git a/hal/hal_com.c b/hal/hal_com.c index 786d957..a0eecd5 100644 --- a/hal/hal_com.c +++ b/hal/hal_com.c @@ -2497,7 +2497,6 @@ void rtw_mbid_cam_deinit(struct dvobj_priv *dvobj) { struct mbid_cam_ctl_t *mbid_cam_ctl = &dvobj->mbid_cam_ctl; - _rtw_spinlock_free(&mbid_cam_ctl->lock); } void rtw_mbid_cam_reset(_adapter *adapter) @@ -14180,10 +14179,7 @@ void rtw_clt_port_init(struct clt_port_t *cltp) cltp->num = 0; _rtw_spinlock_init(&cltp->lock); } -void rtw_clt_port_deinit(struct clt_port_t *cltp) -{ - _rtw_spinlock_free(&cltp->lock); -} + static void _hw_client_port_alloc(_adapter *adapter) { struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); diff --git a/hal/hal_intf.c b/hal/hal_intf.c index 665d8e8..8b3a57b 100644 --- a/hal/hal_intf.c +++ b/hal/hal_intf.c @@ -195,7 +195,6 @@ void rtw_hal_dm_deinit(_adapter *padapter) padapter->hal_func.dm_deinit(padapter); - _rtw_spinlock_free(&pHalData->IQKSpinLock); } } diff --git a/hal/rtl8192e/rtl8192e_dm.c b/hal/rtl8192e/rtl8192e_dm.c index bda7ac2..4c0af26 100644 --- a/hal/rtl8192e/rtl8192e_dm.c +++ b/hal/rtl8192e/rtl8192e_dm.c @@ -326,6 +326,5 @@ void rtl8192e_deinit_dm_priv(IN PADAPTER Adapter) { PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter); struct dm_struct *podmpriv = &pHalData->odmpriv; - /* _rtw_spinlock_free(&pHalData->odm_stainfo_lock); */ odm_cancel_all_timers(podmpriv); } diff --git a/include/osdep_service.h b/include/osdep_service.h index 749189b..7693791 100644 --- a/include/osdep_service.h +++ b/include/osdep_service.h @@ -321,7 +321,6 @@ extern void _rtw_mutex_free(_mutex *pmutex); #ifndef PLATFORM_FREEBSD extern void _rtw_spinlock_init(_lock *plock); #endif /* PLATFORM_FREEBSD */ -extern void _rtw_spinlock_free(_lock *plock); extern void _rtw_spinlock(_lock *plock); extern void _rtw_spinunlock(_lock *plock); extern void _rtw_spinlock_ex(_lock *plock); diff --git a/include/rtw_mlme_ext.h b/include/rtw_mlme_ext.h index 285da31..4324816 100644 --- a/include/rtw_mlme_ext.h +++ b/include/rtw_mlme_ext.h @@ -838,7 +838,6 @@ void rtw_macid_ctl_set_rate_bmp0(struct macid_ctl_t *macid_ctl, u8 id, u32 bmp); void rtw_macid_ctl_set_rate_bmp1(struct macid_ctl_t *macid_ctl, u8 id, u32 bmp); void rtw_macid_ctl_init_sleep_reg(struct macid_ctl_t *macid_ctl, u16 m0, u16 m1, u16 m2, u16 m3); void rtw_macid_ctl_init(struct macid_ctl_t *macid_ctl); -void rtw_macid_ctl_deinit(struct macid_ctl_t *macid_ctl); u8 rtw_iface_bcmc_id_get(_adapter *padapter); void rtw_iface_bcmc_id_set(_adapter *padapter, u8 mac_id); #if defined(DBG_CONFIG_ERROR_RESET) && defined(CONFIG_CONCURRENT_MODE) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index ccf9c64..7846aef 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -10129,12 +10129,9 @@ void rtw_wdev_free(struct wireless_dev *wdev) struct rtw_wdev_priv *wdev_priv = adapter_wdev_data(adapter); _irqL irqL; - _rtw_spinlock_free(&wdev_priv->scan_req_lock); - _enter_critical_bh(&wdev_priv->connect_req_lock, &irqL); rtw_wdev_free_connect_req(wdev_priv); _exit_critical_bh(&wdev_priv->connect_req_lock, &irqL); - _rtw_spinlock_free(&wdev_priv->connect_req_lock); _rtw_mutex_free(&wdev_priv->roch_mutex); } diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index ec2e00a..93ebe21 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -2199,7 +2199,6 @@ void devobj_deinit(struct dvobj_priv *pdvobj) #ifdef CONFIG_MCC_MODE _rtw_mutex_free(&(pdvobj->mcc_objpriv.mcc_mutex)); _rtw_mutex_free(&(pdvobj->mcc_objpriv.mcc_tsf_req_mutex)); - _rtw_spinlock_free(&pdvobj->mcc_objpriv.mcc_lock); #endif /* CONFIG_MCC_MODE */ _rtw_mutex_free(&pdvobj->hw_init_mutex); @@ -2219,22 +2218,10 @@ void devobj_deinit(struct dvobj_priv *pdvobj) _rtw_mutex_free(&pdvobj->syson_indirect_access_mutex); #endif - rtw_macid_ctl_deinit(&pdvobj->macid_ctl); -#ifdef CONFIG_CLIENT_PORT_CFG - rtw_clt_port_deinit(&pdvobj->clt_port); -#endif - - _rtw_spinlock_free(&pdvobj->cam_ctl.lock); _rtw_mutex_free(&pdvobj->cam_ctl.sec_cam_access_mutex); -#if defined(RTK_129X_PLATFORM) && defined(CONFIG_PCI_HCI) - _rtw_spinlock_free(&pdvobj->io_reg_lock); -#endif #ifdef CONFIG_MBSSID_CAM rtw_mbid_cam_deinit(pdvobj); -#endif -#ifdef CONFIG_SUPPORT_MULTI_BCN - _rtw_spinlock_free(&(pdvobj->ap_if_q.lock)); #endif rtw_mfree((u8 *)pdvobj, sizeof(*pdvobj)); } @@ -2580,11 +2567,6 @@ u8 rtw_free_drv_sw(_adapter *padapter) } #endif /* add for CONFIG_IEEE80211W, none 11w also can use */ - _rtw_spinlock_free(&padapter->security_key_mutex); - -#ifdef CONFIG_BR_EXT - _rtw_spinlock_free(&padapter->br_ext_lock); -#endif /* CONFIG_BR_EXT */ #ifdef CONFIG_INTEL_WIDI rtw_free_intel_widi(padapter); diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index 73703ba..e049115 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -1365,19 +1365,6 @@ void _rtw_spinlock_init(_lock *plock) } -void _rtw_spinlock_free(_lock *plock) -{ -#ifdef PLATFORM_FREEBSD - mtx_destroy(plock); -#endif - -#ifdef PLATFORM_WINDOWS - - NdisFreeSpinLock(plock); - -#endif - -} #ifdef PLATFORM_FREEBSD extern PADAPTER prtw_lock; @@ -1484,7 +1471,6 @@ void _rtw_init_queue(_queue *pqueue) void _rtw_deinit_queue(_queue *pqueue) { - _rtw_spinlock_free(&(pqueue->lock)); } u32 _rtw_queue_empty(_queue *pqueue)