From 510176b3ad8e174ab5f130119f0ffa98ccd87a10 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Sun, 21 Apr 2019 11:36:57 -0500 Subject: [PATCH] rtl8188eu: Fix some Sparse warnings Signed-off-by: Larry Finger --- core/rtw_mlme.c | 2 +- core/rtw_recv.c | 6 +++--- core/rtw_sta_mgt.c | 24 ++---------------------- core/rtw_wlan_util.c | 4 ---- core/rtw_xmit.c | 6 ------ hal/hal_dm.c | 2 +- hal/hal_intf.c | 2 +- include/drv_types.h | 1 + os_dep/ioctl_linux.c | 1 - os_dep/mlme_linux.c | 16 ++++++++-------- os_dep/osdep_service.c | 2 +- os_dep/usb_ops_linux.c | 4 ++-- os_dep/xmit_linux.c | 2 +- 13 files changed, 21 insertions(+), 51 deletions(-) diff --git a/core/rtw_mlme.c b/core/rtw_mlme.c index 20ae7a4..536c957 100644 --- a/core/rtw_mlme.c +++ b/core/rtw_mlme.c @@ -119,7 +119,7 @@ exit: return res; } -void rtw_mfree_mlme_priv_lock(struct mlme_priv *pmlmepriv) +static void rtw_mfree_mlme_priv_lock(struct mlme_priv *pmlmepriv) { } diff --git a/core/rtw_recv.c b/core/rtw_recv.c index f08aef6..10c8cb7 100755 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -650,7 +650,7 @@ union recv_frame *decryptor(_adapter *padapter, union recv_frame *precv_frame) return return_packet; } /* ###set the security information in the recv_frame */ -union recv_frame *portctrl(_adapter *adapter, union recv_frame *precv_frame) +static union recv_frame *portctrl(_adapter *adapter, union recv_frame *precv_frame) { u8 *psta_addr = NULL; u8 *ptr; @@ -2194,7 +2194,7 @@ exit: /* remove the wlanhdr and add the eth_hdr */ -sint wlanhdr_to_ethhdr(union recv_frame *precvframe) +static sint wlanhdr_to_ethhdr(union recv_frame *precvframe) { sint rmv_len; u16 eth_type, len; @@ -2308,7 +2308,7 @@ exiting: } /* perform defrag */ -union recv_frame *recvframe_defrag(_adapter *adapter, _queue *defrag_q) +static union recv_frame *recvframe_defrag(_adapter *adapter, _queue *defrag_q) { _list *plist, *phead; u8 *data, wlanhdr_offset; diff --git a/core/rtw_sta_mgt.c b/core/rtw_sta_mgt.c index c9721cf..cbac830 100644 --- a/core/rtw_sta_mgt.c +++ b/core/rtw_sta_mgt.c @@ -312,28 +312,13 @@ 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) -{ -} - -static void _rtw_free_sta_recv_priv_lock(struct sta_recv_priv *psta_recvpriv) -{ -} - -void rtw_mfree_stainfo(struct sta_info *psta) -{ - _rtw_free_sta_xmit_priv_lock(&psta->sta_xmitpriv); - _rtw_free_sta_recv_priv_lock(&psta->sta_recvpriv); -} - /* this function is used to free the memory of lock || sema for all stainfos */ -void rtw_mfree_all_stainfo(struct sta_priv *pstapriv) +static void rtw_mfree_all_stainfo(struct sta_priv *pstapriv) { unsigned long irqL; _list *plist, *phead; struct sta_info *psta = NULL; - _enter_critical_bh(&pstapriv->sta_hash_lock, &irqL); phead = get_list_head(&pstapriv->free_sta_queue); @@ -342,17 +327,12 @@ void rtw_mfree_all_stainfo(struct sta_priv *pstapriv) while ((rtw_end_of_queue_search(phead, plist)) == false) { psta = LIST_CONTAINOR(plist, struct sta_info , list); plist = get_next(plist); - - rtw_mfree_stainfo(psta); } _exit_critical_bh(&pstapriv->sta_hash_lock, &irqL); - - } -void rtw_mfree_sta_priv_lock(struct sta_priv *pstapriv); -void rtw_mfree_sta_priv_lock(struct sta_priv *pstapriv) +static void rtw_mfree_sta_priv_lock(struct sta_priv *pstapriv) { rtw_mfree_all_stainfo(pstapriv); /* be done before free sta_hash_lock */ } diff --git a/core/rtw_wlan_util.c b/core/rtw_wlan_util.c index 6557da5..dedec18 100644 --- a/core/rtw_wlan_util.c +++ b/core/rtw_wlan_util.c @@ -2890,10 +2890,6 @@ void update_wireless_mode(_adapter *padapter) update_mgnt_tx_rate(padapter, IEEE80211_OFDM_RATE_6MB); } -void fire_write_MAC_cmd(_adapter *padapter, unsigned int addr, unsigned int value) -{ -} - void update_sta_basic_rate(struct sta_info *psta, u8 wireless_mode) { if (IsSupportedTxCCK(wireless_mode)) { diff --git a/core/rtw_xmit.c b/core/rtw_xmit.c index adce453..7dbcad2 100644 --- a/core/rtw_xmit.c +++ b/core/rtw_xmit.c @@ -309,10 +309,6 @@ exit: return res; } -void rtw_mfree_xmit_priv_lock(struct xmit_priv *pxmitpriv) -{ -} - void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv) { int i; @@ -322,8 +318,6 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv) rtw_hal_free_xmit_priv(padapter); - rtw_mfree_xmit_priv_lock(pxmitpriv); - if (pxmitpriv->pxmit_frame_buf == NULL) goto out; diff --git a/hal/hal_dm.c b/hal/hal_dm.c index 4c81390..9b5ba94 100644 --- a/hal/hal_dm.c +++ b/hal/hal_dm.c @@ -22,7 +22,7 @@ #include /* A mapping from HalData to ODM. */ -enum odm_board_type_e boardType(u8 InterfaceSel) +static enum odm_board_type_e boardType(u8 InterfaceSel) { enum odm_board_type_e board = ODM_BOARD_DEFAULT; diff --git a/hal/hal_intf.c b/hal/hal_intf.c index b3c65a8..14d1f39 100644 --- a/hal/hal_intf.c +++ b/hal/hal_intf.c @@ -179,7 +179,7 @@ void rtw_hal_power_off(_adapter *padapter) } -void rtw_hal_init_opmode(_adapter *padapter) +static void rtw_hal_init_opmode(_adapter *padapter) { NDIS_802_11_NETWORK_INFRASTRUCTURE networkType = Ndis802_11InfrastructureMax; struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); diff --git a/include/drv_types.h b/include/drv_types.h index e932563..b05b497 100644 --- a/include/drv_types.h +++ b/include/drv_types.h @@ -1395,6 +1395,7 @@ void *scdb_findEntry(_adapter *priv, unsigned char *macAddr, void dhcp_flag_bcast(_adapter *priv, struct sk_buff *skb); int rtw_suspend_free_assoc_resource(_adapter *padapter); int recvbuf2recvframe(PADAPTER padapter, void *ptr); +int rtw_change_ifname(_adapter *padapter, const char *ifname); #ifdef CONFIG_WOWLAN int rtw_suspend_wow(_adapter *padapter); diff --git a/os_dep/ioctl_linux.c b/os_dep/ioctl_linux.c index 15d8910..06c4bc3 100644 --- a/os_dep/ioctl_linux.c +++ b/os_dep/ioctl_linux.c @@ -5788,7 +5788,6 @@ static int rtw_cta_test_start(struct net_device *dev, } -extern int rtw_change_ifname(_adapter *padapter, const char *ifname); static int rtw_rereg_nd_name(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) diff --git a/os_dep/mlme_linux.c b/os_dep/mlme_linux.c index 41fe5af..4c48962 100644 --- a/os_dep/mlme_linux.c +++ b/os_dep/mlme_linux.c @@ -136,9 +136,9 @@ void _dynamic_check_timer_handler(struct timer_list *t) #ifdef CONFIG_SET_SCAN_DENY_TIMER #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) -void _rtw_set_scan_deny_timer_hdl(void *FunctionContext) +istatic void _rtw_set_scan_deny_timer_hdl(void *FunctionContext) #else -void _rtw_set_scan_deny_timer_hdl(struct timer_list *t) +static void _rtw_set_scan_deny_timer_hdl(struct timer_list *t) #endif { #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) @@ -353,9 +353,9 @@ void rtw_report_sec_ie(_adapter *adapter, u8 authmode, u8 *sec_ie) } #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) -void _survey_timer_hdl(void *FunctionContext) +static void _survey_timer_hdl(void *FunctionContext) #else -void _survey_timer_hdl(struct timer_list *t) +static void _survey_timer_hdl(struct timer_list *t) #endif { #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) @@ -368,9 +368,9 @@ void _survey_timer_hdl(struct timer_list *t) } #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) -void _link_timer_hdl(void *FunctionContext) +static void _link_timer_hdl(void *FunctionContext) #else -void _link_timer_hdl(struct timer_list *t) +static void _link_timer_hdl(struct timer_list *t) #endif { #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) @@ -415,9 +415,9 @@ void _ft_roam_timer_hdl(struct timer_list *t); #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) -void _addba_timer_hdl(void *FunctionContext) +static void _addba_timer_hdl(void *FunctionContext) #else -void _addba_timer_hdl(struct timer_list *t) +static void _addba_timer_hdl(struct timer_list *t) #endif { #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index a8ed81c..e31481b 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -1084,7 +1084,7 @@ static int writeFile(struct file *fp, char *buf, int len) return -EPERM; while (sum < len) { - wlen = fp->f_op->write(fp, buf + sum, len - sum, &fp->f_pos); + wlen = fp->f_op->write(fp, (char __user *)buf + sum, len - sum, &fp->f_pos); if (wlen > 0) sum += wlen; else if (0 != wlen) diff --git a/os_dep/usb_ops_linux.c b/os_dep/usb_ops_linux.c index 3a27893..5b4d06e 100644 --- a/os_dep/usb_ops_linux.c +++ b/os_dep/usb_ops_linux.c @@ -666,7 +666,7 @@ void usb_write_port_cancel(struct intf_hdl *pintfhdl) } } -void usb_init_recvbuf(_adapter *padapter, struct recv_buf *precvbuf) +static void usb_init_recvbuf(_adapter *padapter, struct recv_buf *precvbuf) { precvbuf->transfer_len = 0; @@ -858,7 +858,7 @@ void usb_recv_tasklet(void *priv) } } -void usb_read_port_complete(struct urb *purb, struct pt_regs *regs) +static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs) { struct recv_buf *precvbuf = (struct recv_buf *)purb->context; _adapter *padapter = (_adapter *)precvbuf->adapter; diff --git a/os_dep/xmit_linux.c b/os_dep/xmit_linux.c index d7c91c1..00a704b 100644 --- a/os_dep/xmit_linux.c +++ b/os_dep/xmit_linux.c @@ -332,7 +332,7 @@ void rtw_os_wake_queue_at_free_stainfo(_adapter *padapter, int *qcnt_freed) } #ifdef CONFIG_TX_MCAST2UNI -int rtw_mlcst2unicst(_adapter *padapter, struct sk_buff *skb) +static int rtw_mlcst2unicst(_adapter *padapter, struct sk_buff *skb) { struct sta_priv *pstapriv = &padapter->stapriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv;