staging: r8188eu: Fixed some coding style issues
cover staging: r8188eu: Fixed some coding style issues
Fixed a few coding style issues as per checkpatch.pl and kernel coding style guidelines.
Chang Yu (5):
staging: r8188eu: Fixed a function declaration coding style issue
staging: r8188eu: Fixed two brace coding style issues
staging: r8188eu: Fixed two whitespace coding style issues
staging: r8188eu: Fixed comment style
staging: r8188eu: Fixed some blank line coding style issues
drivers/staging/r8188eu/core/rtw_recv.c | 38 +++++++++++++++---------- 1 file changed, 23 insertions(+), 15 deletions(-)
Signature · 1 line
2.36.1
PATCH 1/5 staging: r8188eu: Fixed a function declaration coding style issue
Added an identifier name for function definition argument 'struct timer_list *' as per checkpatch.pl
Note that for the same line checkpatch.pl will also complain "extern should be avoided in .c". I am not very familiar with the codebase so I decided not to move the declaration to a header file.
--- drivers/staging/r8188eu/core/rtw_recv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/r8188eu/core/rtw_recv.c +1 -1
@@ -24,7 +24,7 @@ static u8 rtw_rfc1042_header[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 }; -void rtw_signal_stat_timer_hdl (struct timer_list *); +void rtw_signal_stat_timer_hdl (struct timer_list *t);void _rtw_init_sta_recv_priv (struct sta_recv_priv *psta_recvpriv) {
Signature · 1 line
2.36.1
Greg KH
maintainerRe: [PATCH 1/5] staging: r8188eu: Fixed a function declaration coding style issue
Quoted 17 lines · Chang Yu
Added an identifier name for function definition argument 'struct
timer_list*' as per checkpatch.plNote that for the same line checkpatch.pl will also complain "extern should be avoided in .c". I am not very familiar with the codebase so I decided not to move the declaration to a header file.
Signed-off-by Chang Yu <[email protected]>--- drivers/staging/r8188eu/core/rtw_recv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/r8188eu/core/rtw_recv.c +0
-0
drivers/staging/r8188eu/core/rtw_recv.c static u8 rtw_rfc1042_header[] = { · line 27
Quoted 5 lines
drivers/staging/r8188eu/core/rtw_recv.c +1
-1@@ -24,7 +24,7 @@ static u8 rtw_rfc1042_header[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 }; -void rtw_signal_stat_timer_hdl (struct timer_list *); +void rtw_signal_stat_timer_hdl (struct timer_list *t);
This really should be a static function, not a global one like this. That is the correct fix to make, can you do that as an add-on patch?
thanks,
greg k-h
PATCH 2/5 staging: r8188eu: Fixed two brace coding style issues
In reply to Chang YuRemoved two pairs of unnecessary curly braces as per checkpatch.pl
--- drivers/staging/r8188eu/core/rtw_recv.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/staging/r8188eu/core/rtw_recv.c +3 -4
@@ -1365,13 +1365,12 @@ static int amsdu_to_msdu(struct adapter *padapter, struct recv_frame *prframe) a_len -= nSubframe_Length;if (a_len !=0 ) { padding_len =4 - ((nSubframe_Length +ETH_HLEN ) & (4 -1 )); -if (padding_len ==4 ) { +if (padding_len ==4 ) padding_len =0 ; - } -if (a_len < padding_len) { +if (a_len < padding_len) goto exit; - } + pdata += padding_len; a_len -= padding_len; }
Signature · 1 line
2.36.1
PATCH 3/5 staging: r8188eu: Fixed two whitespace coding style issues
In reply to Chang YuReplaced spaces with tabs as per checkpatch.pl
--- drivers/staging/r8188eu/core/rtw_recv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/r8188eu/core/rtw_recv.c +2 -2
@@ -17,11 +17,11 @@ static u8 SNAP_ETH_TYPE_APPLETALK_AARP[2] = {0x80, 0xf3};/* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */ static u8 rtw_bridge_tunnel_header[] = { -0xaa ,0xaa ,0x03 ,0x00 ,0x00 ,0xf8 +0xaa ,0xaa ,0x03 ,0x00 ,0x00 ,0xf8 };static u8 rtw_rfc1042_header[] = { -0xaa ,0xaa ,0x03 ,0x00 ,0x00 ,0x00 +0xaa ,0xaa ,0x03 ,0x00 ,0x00 ,0x00 };void rtw_signal_stat_timer_hdl (struct timer_list *t);
Signature · 1 line
2.36.1
PATCH 4/5 staging: r8188eu: Fixed comment style
In reply to Chang YuFixed block comments style as per checkpatch.pl and kernel coding style guide.
--- drivers/staging/r8188eu/core/rtw_recv.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
drivers/staging/r8188eu/core/rtw_recv.c +10 -8
@@ -204,12 +204,12 @@ int rtw_enqueue_recvframe(struct recv_frame *precvframe, struct __queue *queue) }/* -caller : defrag ; recvframe_chk_defrag in recv_thread (passive) -pframequeue: defrag_queue : will be accessed in recv_thread (passive) - -using spinlock to protect - -*/ +* caller : defrag ; recvframe_chk_defrag in recv_thread (passive) +* pframequeue: defrag_queue : will be accessed in recv_thread (passive) +* +* using spinlock to protect +* +*/ void rtw_free_recvframe_queue (struct __queue *pframequeue,struct __queue *pfree_recv_queue) {
@@ -1745,9 +1745,11 @@ static int recv_func(struct adapter *padapter, struct recv_frame *rframe) !psecuritypriv->busetkipkey) {rtw_enqueue_recvframe (rframe, &padapter->recvpriv.uc_swdec_pending_queue);if (recvpriv->free_recvframe_cnt <NR_RECVFRAME /4 ) { -/* to prevent from recvframe starvation, +/* +* to prevent from recvframe starvation, * get recvframe from uc_swdec_pending_queue to -* free_recvframe_cnt */ +* free_recvframe_cnt +*/ rframe =rtw_alloc_recvframe (&padapter->recvpriv.uc_swdec_pending_queue);if (rframe) goto do_posthandle;
Signature · 1 line
2.36.1
PATCH 5/5 staging: r8188eu: Fixed some blank line coding style issues
In reply to Chang YuAdded blank lines after variable declarations as per checkpatch.pl
--- drivers/staging/r8188eu/core/rtw_recv.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/staging/r8188eu/core/rtw_recv.c +7 -0
@@ -237,6 +237,7 @@ u32 rtw_free_uc_swdec_pending_queue(struct adapter *adapter) {u32 cnt =0 ;struct recv_frame *pending_frame; +while ((pending_frame =rtw_alloc_recvframe (&adapter->recvpriv.uc_swdec_pending_queue))) {rtw_free_recvframe (pending_frame, &adapter->recvpriv.free_recv_queue); cnt++;
@@ -327,6 +328,7 @@ static struct recv_frame *decryptor(struct adapter *padapter, struct recv_frameif (prxattrib->encrypt >0 ) {u8 *iv = precv_frame->rx_data + prxattrib->hdrlen; + prxattrib->key_index = (((iv[3 ]) >>6 ) &0x3 );if (prxattrib->key_index >WEP_KEYS ) {
@@ -777,6 +779,7 @@ static int sta2ap_data_frame(struct adapter *adapter, } }else {u8 *myhwaddr =myid (&adapter->eeprompriv); +if (memcmp (pattrib->ra, myhwaddr,ETH_ALEN )) { ret =RTW_RX_HANDLED ; goto exit;
@@ -1022,6 +1025,7 @@ static int validate_recv_frame(struct adapter *adapter, struct recv_frame *precvif (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 ) pmlmeext->channel_set[ch_set_idx].rx_count++; }
@@ -1049,6 +1053,7 @@ static int validate_recv_frame(struct adapter *adapter, struct recv_frame *precv retval =validate_recv_data_frame (adapter, precv_frame);if (retval == _FAIL) {struct recv_priv *precvpriv = &adapter->recvpriv; + precvpriv->rx_drop++; } }
@@ -1312,9 +1317,11 @@ static int amsdu_to_msdu(struct adapter *padapter, struct recv_frame *prframe)struct rx_pkt_attrib *pattrib;unsigned char *data_ptr;struct sk_buff *sub_skb, *subframes[MAX_SUBFRAME_COUNT ]; +struct recv_priv *precvpriv = &padapter->recvpriv;struct __queue *pfree_recv_queue = &precvpriv->free_recv_queue;int ret = _SUCCESS; + nr_subframes =0 ; pattrib = &prframe->attrib;
Signature · 1 line
2.36.1
Quoted 10 lines · Chang Yu
Fixed a few coding style issues as per checkpatch.pl and kernel coding style guidelines.
Chang Yu (5):
staging: r8188eu: Fixed a function declaration coding style issue
staging: r8188eu: Fixed two brace coding style issues
staging: r8188eu: Fixed two whitespace coding style issues
staging: r8188eu: Fixed comment style
staging: r8188eu: Fixed some blank line coding style issues
Quoted 3 lines
drivers/staging/r8188eu/core/rtw_recv.c | 38 +++++++++++++++---------- 1 file changed, 23 insertions(+), 15 deletions(-)