staging: rtl8188eu: remove unused argument
PATCH 1/7 staging: rtl8188eu: remove unused argument
The function rtw_os_recv_resource_alloc() only uses the argument struct recv_frame *. So remove the other unused argument.
--- drivers/staging/rtl8188eu/core/rtw_recv.c | 2 +- drivers/staging/rtl8188eu/include/recv_osdep.h | 3 +-- drivers/staging/rtl8188eu/os_dep/recv_linux.c | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-)
drivers/staging/rtl8188eu/core/rtw_recv.c +1 -1
@@ -89,7 +89,7 @@ int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter)list_add_tail (&(precvframe->list), &(precvpriv->free_recv_queue.queue)); - res =rtw_os_recv_resource_alloc (padapter, precvframe); + res =rtw_os_recv_resource_alloc (precvframe); precvframe->len =0 ;
drivers/staging/rtl8188eu/include/recv_osdep.h +1 -2
@@ -38,8 +38,7 @@ void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup);int rtw_init_recv_priv (struct recv_priv *precvpriv,struct adapter *padapter);void rtw_free_recv_priv (struct recv_priv *precvpriv); -int rtw_os_recv_resource_alloc (struct adapter *adapt, -struct recv_frame *recvfr); +int rtw_os_recv_resource_alloc (struct recv_frame *recvfr);int rtw_os_recvbuf_resource_alloc (struct adapter *adapt,struct recv_buf *buf);
drivers/staging/rtl8188eu/os_dep/recv_linux.c +1 -2
@@ -29,8 +29,7 @@#include <usb_ops_linux.h> /* alloc os related resource in struct recv_frame */ -int rtw_os_recv_resource_alloc (struct adapter *padapter, -struct recv_frame *precvframe) +int rtw_os_recv_resource_alloc (struct recv_frame *precvframe) { precvframe->pkt_newalloc =NULL ; precvframe->pkt =NULL ;
Signature · 1 line
1.9.1
PATCH 2/7 staging: rtl8188eu: make function void
The return value of rtw_os_recv_resource_alloc() is never checked, so make it as void. Moreover as of now the function can not fail.
--- drivers/staging/rtl8188eu/core/rtw_recv.c | 2 +- drivers/staging/rtl8188eu/include/recv_osdep.h | 2 +- drivers/staging/rtl8188eu/os_dep/recv_linux.c | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-)
drivers/staging/rtl8188eu/core/rtw_recv.c +1 -1
@@ -89,7 +89,7 @@ int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter)list_add_tail (&(precvframe->list), &(precvpriv->free_recv_queue.queue)); - res =rtw_os_recv_resource_alloc (precvframe); +rtw_os_recv_resource_alloc (precvframe); precvframe->len =0 ;
drivers/staging/rtl8188eu/include/recv_osdep.h +1 -1
@@ -38,7 +38,7 @@ void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup);int rtw_init_recv_priv (struct recv_priv *precvpriv,struct adapter *padapter);void rtw_free_recv_priv (struct recv_priv *precvpriv); -int rtw_os_recv_resource_alloc (struct recv_frame *recvfr); +void rtw_os_recv_resource_alloc (struct recv_frame *recvfr);int rtw_os_recvbuf_resource_alloc (struct adapter *adapt,struct recv_buf *buf);
drivers/staging/rtl8188eu/os_dep/recv_linux.c +1 -2
@@ -29,11 +29,10 @@#include <usb_ops_linux.h> /* alloc os related resource in struct recv_frame */ -int rtw_os_recv_resource_alloc (struct recv_frame *precvframe) +void rtw_os_recv_resource_alloc (struct recv_frame *precvframe) { precvframe->pkt_newalloc =NULL ; precvframe->pkt =NULL ; -return _SUCCESS; }/* alloc os related resource in struct recv_buf */
Signature · 1 line
1.9.1
PATCH 3/7 staging: rtl8188eu: rearrange code
In reply to Sudip MukherjeeRe-arrange the code to directly return success or failure, thus removing the variable used in the function.
--- drivers/staging/rtl8188eu/os_dep/recv_linux.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/staging/rtl8188eu/os_dep/recv_linux.c +4 -6
@@ -39,14 +39,12 @@ void rtw_os_recv_resource_alloc(struct recv_frame *precvframe)int rtw_os_recvbuf_resource_alloc (struct adapter *padapter,struct recv_buf *precvbuf) { -int res = _SUCCESS; - - precvbuf->purb =usb_alloc_urb (0 ,GFP_KERNEL ); -if (precvbuf->purb ==NULL ) - res = _FAIL; precvbuf->pskb =NULL ; precvbuf->reuse = false; -return res; + precvbuf->purb =usb_alloc_urb (0 ,GFP_KERNEL ); +if (!precvbuf->purb) +return _FAIL; +return _SUCCESS; }void rtw_handle_tkip_mic_err (struct adapter *padapter,u8 bgroup)
Signature · 1 line
1.9.1
PATCH 4/7 staging: rtl8188eu: remove unused define
In reply to Sudip Mukherjee_RECV_OSDEP_C_ was only defined here but never checked anywhere.
--- drivers/staging/rtl8188eu/os_dep/recv_linux.c | 2 -- 1 file changed, 2 deletions(-)
drivers/staging/rtl8188eu/os_dep/recv_linux.c +0 -2
@@ -17,8 +17,6 @@* * ******************************************************************************/ -#define _RECV_OSDEP_C_ -#include <osdep_service.h> #include <drv_types.h>
Signature · 1 line
1.9.1
PATCH 7/7 staging: rtl8188eu: remove multiple blank line
In reply to Sudip MukherjeeMultiple blank lines is against the kernel coding style and checkpatch complains for that.
--- drivers/staging/rtl8188eu/core/rtw_recv.c | 26 -------------------------- 1 file changed, 26 deletions(-)
drivers/staging/rtl8188eu/core/rtw_recv.c +0 -26
@@ -113,7 +113,6 @@ void _rtw_free_recv_priv(struct recv_priv *precvpriv) {struct adapter *padapter = precvpriv->adapter; -rtw_free_uc_swdec_pending_queue (padapter);if (precvpriv->pallocated_frame_buf) {
@@ -149,7 +148,6 @@ struct recv_frame *_rtw_alloc_recvframe(struct __queue *pfree_recv_queue) } } -return (struct recv_frame *)hdr; }
@@ -196,7 +194,6 @@ int rtw_free_recvframe(struct recv_frame *precvframe,spin_unlock_bh (&pfree_recv_queue->lock); -return _SUCCESS; }
@@ -205,7 +202,6 @@ int _rtw_enqueue_recvframe(struct recv_frame *precvframe, struct __queue *queue)struct adapter *padapter = precvframe->adapter;struct recv_priv *precvpriv = &padapter->recvpriv; -list_del_init (&(precvframe->list));list_add_tail (&(precvframe->list),get_list_head (queue));
@@ -214,7 +210,6 @@ int _rtw_enqueue_recvframe(struct recv_frame *precvframe, struct __queue *queue) precvpriv->free_recvframe_cnt++; } -return _SUCCESS; }
@@ -409,7 +404,6 @@ static int recvframe_chkmic(struct adapter *adapter, exit: -return res; }
@@ -471,7 +465,6 @@ static struct recv_frame *decryptor(struct adapter *padapter, return_packet =NULL ; } -return return_packet; }
@@ -490,7 +483,6 @@ static struct recv_frame *portctrl(struct adapter *adapter,struct rx_pkt_attrib *pattrib;__be16 be_tmp; - pstapriv = &adapter->stapriv; auth_alg = adapter->securitypriv.dot11AuthAlgrthm;
@@ -549,7 +541,6 @@ static struct recv_frame *portctrl(struct adapter *adapter, prtnframe = precv_frame; } -return prtnframe; }
@@ -561,7 +552,6 @@ static int recv_decache(struct recv_frame *precv_frame, u8 bretry,u16 seq_ctrl = ((precv_frame->attrib.seq_num&0xffff ) <<4 ) | (precv_frame->attrib.frag_num &0xf ); -if (tid >15 ) {RT_TRACE (_module_rtl871x_recv_c_, _drv_notice_, ("recv_decache, (tid>15)! seq_ctrl=0x%x, tid=0x%x\n" , seq_ctrl, tid));
@@ -578,7 +568,6 @@ static int recv_decache(struct recv_frame *precv_frame, u8 bretry, prxcache->tid_rxseq[tid] = seq_ctrl; -return _SUCCESS; }
@@ -715,7 +704,6 @@ int sta2sta_data_frame(struct adapter *adapter, struct recv_frame *precv_frame,u8 *sta_addr =NULL ;int bmcast =IS_MCAST (pattrib->dst); -if ((check_fwstate (pmlmepriv,WIFI_ADHOC_STATE ) == true) || (check_fwstate (pmlmepriv,WIFI_ADHOC_MASTER_STATE ) == true)) {/* filter packets that SA is myself or multicast or broadcast */
@@ -803,7 +791,6 @@ static int ap2sta_data_frame(u8 *myhwaddr =myid (&adapter->eeprompriv);int bmcast =IS_MCAST (pattrib->dst); -if ((check_fwstate (pmlmepriv,WIFI_STATION_STATE ) == true) && (check_fwstate (pmlmepriv, _FW_LINKED) == true ||check_fwstate (pmlmepriv, _FW_UNDER_LINKING))) {
@@ -895,7 +882,6 @@ static int ap2sta_data_frame( exit: -return ret; }
@@ -910,7 +896,6 @@ static int sta2ap_data_frame(struct adapter *adapter,unsigned char *mybssid =get_bssid (pmlmepriv);int ret = _SUCCESS; -if (check_fwstate (pmlmepriv,WIFI_AP_STATE ) == true) {/* For AP mode, RA = BSSID, TX = STA(SRC_ADDR), A3 = DST_ADDR */ if (memcmp (pattrib->bssid, mybssid,ETH_ALEN )) {
@@ -955,7 +940,6 @@ static int sta2ap_data_frame(struct adapter *adapter, exit: -return ret; }
@@ -1137,7 +1121,6 @@ static int validate_recv_data_frame(struct adapter *adapter,struct security_priv *psecuritypriv = &adapter->securitypriv;int ret = _SUCCESS; - bretry =GetRetry (ptr); pda =get_da (ptr); psa =get_sa (ptr);
@@ -1241,7 +1224,6 @@ static int validate_recv_data_frame(struct adapter *adapter, exit: -return ret; }
@@ -1261,7 +1243,6 @@ static int validate_recv_frame(struct adapter *adapter,u8 ver = (unsigned char )(*ptr)&0x3 ;struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv; -if (pmlmeext->sitesurvey_res.state ==SCAN_PROCESS ) {int ch_set_idx =rtw_ch_set_search_ch (pmlmeext->channel_set,rtw_get_oper_ch (adapter));if (ch_set_idx >=0 )
@@ -1350,7 +1331,6 @@ static int validate_recv_frame(struct adapter *adapter, exit: -return retval; }
@@ -1433,7 +1413,6 @@ static struct recv_frame *recvframe_defrag(struct adapter *adapter,struct recv_frame *prframe, *pnextrframe;struct __queue *pfree_recv_queue; - curfragnum =0 ; pfree_recv_queue = &adapter->recvpriv.free_recv_queue;
@@ -1498,7 +1477,6 @@ static struct recv_frame *recvframe_defrag(struct adapter *adapter,RT_TRACE (_module_rtl871x_recv_c_, _drv_info_, ("Performance defrag!!!!!\n" )); -return prframe; }
@@ -1516,7 +1494,6 @@ struct recv_frame *recvframe_chk_defrag(struct adapter *padapter,struct recv_frame *prtnframe =NULL ;struct __queue *pfree_recv_queue, *pdefrag_q; - pstapriv = &padapter->stapriv; pfhdr = precv_frame;
@@ -1600,7 +1577,6 @@ struct recv_frame *recvframe_chk_defrag(struct adapter *padapter, } } -return prtnframe; }
@@ -2104,7 +2080,6 @@ s32 rtw_recv_entry(struct recv_frame *precvframe)struct recv_priv *precvpriv;s32 ret = _SUCCESS; - padapter = precvframe->adapter; precvpriv = &padapter->recvpriv;
@@ -2117,7 +2092,6 @@ s32 rtw_recv_entry(struct recv_frame *precvframe) precvpriv->rx_pkts++; -return ret; _recv_entry_drop:
Signature · 1 line
1.9.1
PATCH 6/7 staging: rtl8188eu: remove unused function
In reply to Sudip MukherjeeThe function rtw_init_recvframe() was not being used.
--- drivers/staging/rtl8188eu/core/rtw_recv.c | 8 -------- 1 file changed, 8 deletions(-)
drivers/staging/rtl8188eu/core/rtw_recv.c +0 -8
@@ -166,14 +166,6 @@ struct recv_frame *rtw_alloc_recvframe(struct __queue *pfree_recv_queue)return precvframe; } -void rtw_init_recvframe (struct recv_frame *precvframe,struct recv_priv *precvpriv) -{ -/* Perry: This can be removed */ -INIT_LIST_HEAD (&precvframe->list); - - precvframe->len =0 ; -} -int rtw_free_recvframe (struct recv_frame *precvframe,struct __queue *pfree_recv_queue) {
Signature · 1 line
1.9.1
PATCH 5/7 staging: rtl8188eu: remove exit label
In reply to Sudip MukherjeeAn exit label which does nothing except return, is not worth having. So remove it.
--- drivers/staging/rtl8188eu/core/rtw_recv.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/staging/rtl8188eu/core/rtw_recv.c +2 -6
@@ -74,10 +74,8 @@ int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter) precvpriv->pallocated_frame_buf =vzalloc (NR_RECVFRAME *sizeof (struct recv_frame ) +RXFRAME_ALIGN_SZ ); -if (precvpriv->pallocated_frame_buf ==NULL ) { - res = _FAIL; - goto exit; - } +if (!precvpriv->pallocated_frame_buf) +return _FAIL; precvpriv->precv_frame_buf = (u8 *)N_BYTE_ALIGMENT ((size_t )(precvpriv->pallocated_frame_buf),RXFRAME_ALIGN_SZ );
@@ -107,8 +105,6 @@ int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter) precvpriv->signal_stat_sampling_interval =1000 ;/* ms */ rtw_set_signal_stat_timer (precvpriv); -exit: -return res; }
Signature · 1 line
1.9.1