Fix checkpatch.pl warnings
v2 cover Fix checkpatch.pl warnings
Use __func__ in debugging messages to display the function name. Also, fix checkpatch.pl warnings related to the changes from 1/3 patch.
Changes v2:
* Nothing changed in 1/3
* Added 2/3 and 3/3 patches
Georgiana Chelu (3):
Staging: rtl8188eu: core: Use __func__ instead of function name
Staging: rtl8188eu: core: Add spaces around '+'
Staging: rtl8188eu: core: Fix line over 80 characters
drivers/staging/rtl8188eu/core/rtw_recv.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-)
Signature · 1 line
2.7.4
PATCH v2 1/3 Staging: rtl8188eu: core: Use __func__ instead of function name
Replace the function name from format string with the constant __func__ to avoid multiple changes in case the name of the function will be modified.
Issue reported by checkpatch.pl script.
---
Changes in v2:
* nothing
drivers/staging/rtl8188eu/core/rtw_recv.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/staging/rtl8188eu/core/rtw_recv.c +10 -10
@@ -237,25 +237,25 @@ static int recvframe_chkmic(struct adapter *adapter, stainfo =rtw_get_stainfo (&adapter->stapriv, &prxattrib->ta[0 ]);if (prxattrib->encrypt == _TKIP_) { -RT_TRACE (_module_rtl871x_recv_c_, _drv_info_, ("\n recvframe_chkmic:prxattrib->encrypt==_TKIP_\n" )); -RT_TRACE (_module_rtl871x_recv_c_, _drv_info_, ("\n recvframe_chkmic:da=0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x\n" , - prxattrib->ra[0 ], prxattrib->ra[1 ], prxattrib->ra[2 ], prxattrib->ra[3 ], prxattrib->ra[4 ], prxattrib->ra[5 ])); +RT_TRACE (_module_rtl871x_recv_c_, _drv_info_, ("\n %s: prxattrib->encrypt==_TKIP_\n" , __func__)); +RT_TRACE (_module_rtl871x_recv_c_, _drv_info_, ("\n %s: da=0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x\n" , + __func__, prxattrib->ra[0 ], prxattrib->ra[1 ], prxattrib->ra[2 ], prxattrib->ra[3 ], prxattrib->ra[4 ], prxattrib->ra[5 ]));/* calculate mic code */ if (stainfo !=NULL ) {if (IS_MCAST (prxattrib->ra)) {if (!psecuritypriv) { res = _FAIL; -RT_TRACE (_module_rtl871x_recv_c_, _drv_err_, ("\n recvframe_chkmic:didn't install group key!!!!!!!!!!\n" )); -DBG_88E ("\n recvframe_chkmic:didn't install group key!!!!!!!!!!\n" ); +RT_TRACE (_module_rtl871x_recv_c_, _drv_err_, ("\n %s: didn't install group key!!!!!!!!!!\n" , __func__)); +DBG_88E ("\n %s: didn't install group key!!!!!!!!!!\n" , __func__); goto exit; } mickey = &psecuritypriv->dot118021XGrprxmickey[prxattrib->key_index].skey[0 ]; -RT_TRACE (_module_rtl871x_recv_c_, _drv_info_, ("\n recvframe_chkmic: bcmc key\n" )); +RT_TRACE (_module_rtl871x_recv_c_, _drv_info_, ("\n %s: bcmc key\n" , __func__)); }else { mickey = &stainfo->dot11tkiprxmickey.skey[0 ]; -RT_TRACE (_module_rtl871x_recv_c_, _drv_err_, ("\n recvframe_chkmic: unicast key\n" )); +RT_TRACE (_module_rtl871x_recv_c_, _drv_err_, ("\n %s: unicast key\n" , __func__)); }/* icv_len included the mic code */
@@ -273,8 +273,8 @@ static int recvframe_chkmic(struct adapter *adapter,for (i =0 ; i <8 ; i++) {if (miccode[i] != *(pframemic+i)) {RT_TRACE (_module_rtl871x_recv_c_, _drv_err_, - ("recvframe_chkmic:miccode[%d](%02x)!=*(pframemic+%d)(%02x) " , - i, miccode[i], i, *(pframemic+i))); + ("%s: miccode[%d](%02x)!=*(pframemic+%d)(%02x) " , + __func__, i, miccode[i], i, *(pframemic+i))); bmic_err = true; } }
@@ -346,7 +346,7 @@ static int recvframe_chkmic(struct adapter *adapter, } } }else { -RT_TRACE (_module_rtl871x_recv_c_, _drv_err_, ("recvframe_chkmic: rtw_get_stainfo==NULL!!!\n" )); +RT_TRACE (_module_rtl871x_recv_c_, _drv_err_, ("%s: rtw_get_stainfo==NULL!!!\n" , __func__)); }skb_trim (precvframe->pkt, precvframe->pkt->len -8 );
Signature · 1 line
2.7.4
PATCH v2 2/3 Staging: rtl8188eu: core: Add spaces around '+'
In reply to Georgiana CheluImprove the coding style by adding spaces around
arithmetic operation.
Issue reported by checkpatch.pl script.
---
Changes in v2:
* new patch added to the patchset
drivers/staging/rtl8188eu/core/rtw_recv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8188eu/core/rtw_recv.c +1 -1
@@ -274,7 +274,7 @@ static int recvframe_chkmic(struct adapter *adapter,if (miccode[i] != *(pframemic+i)) {RT_TRACE (_module_rtl871x_recv_c_, _drv_err_, ("%s: miccode[%d](%02x)!=*(pframemic+%d)(%02x) " , - __func__, i, miccode[i], i, *(pframemic+i))); + __func__, i, miccode[i], i, *(pframemic + i))); bmic_err = true; } }
Signature · 1 line
2.7.4
PATCH v2 3/3 Staging: rtl8188eu: core: Fix line over 80 characters
In reply to Georgiana CheluFix warning reported by checkpatch.pl script:
WARNING: line over 80 characters
---
Changes in v2:
* new patch added to the patchset
drivers/staging/rtl8188eu/core/rtw_recv.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-)
drivers/staging/rtl8188eu/core/rtw_recv.c +16 -8
@@ -237,25 +237,31 @@ static int recvframe_chkmic(struct adapter *adapter, stainfo =rtw_get_stainfo (&adapter->stapriv, &prxattrib->ta[0 ]);if (prxattrib->encrypt == _TKIP_) { -RT_TRACE (_module_rtl871x_recv_c_, _drv_info_, ("\n %s: prxattrib->encrypt==_TKIP_\n" , __func__)); -RT_TRACE (_module_rtl871x_recv_c_, _drv_info_, ("\n %s: da=0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x\n" , - __func__, prxattrib->ra[0 ], prxattrib->ra[1 ], prxattrib->ra[2 ], prxattrib->ra[3 ], prxattrib->ra[4 ], prxattrib->ra[5 ])); +RT_TRACE (_module_rtl871x_recv_c_, _drv_info_, + ("\n %s: prxattrib->encrypt==_TKIP_\n" , __func__)); +RT_TRACE (_module_rtl871x_recv_c_, _drv_info_, + ("\n %s: da=0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x\n" , + __func__, prxattrib->ra[0 ], prxattrib->ra[1 ], prxattrib->ra[2 ], + prxattrib->ra[3 ], prxattrib->ra[4 ], prxattrib->ra[5 ]));/* calculate mic code */ if (stainfo !=NULL ) {if (IS_MCAST (prxattrib->ra)) {if (!psecuritypriv) { res = _FAIL; -RT_TRACE (_module_rtl871x_recv_c_, _drv_err_, ("\n %s: didn't install group key!!!!!!!!!!\n" , __func__)); +RT_TRACE (_module_rtl871x_recv_c_, _drv_err_, + ("\n %s: didn't install group key!!!!!!!!!!\n" , __func__));DBG_88E ("\n %s: didn't install group key!!!!!!!!!!\n" , __func__); goto exit; } mickey = &psecuritypriv->dot118021XGrprxmickey[prxattrib->key_index].skey[0 ]; -RT_TRACE (_module_rtl871x_recv_c_, _drv_info_, ("\n %s: bcmc key\n" , __func__)); +RT_TRACE (_module_rtl871x_recv_c_, _drv_info_, + ("\n %s: bcmc key\n" , __func__)); }else { mickey = &stainfo->dot11tkiprxmickey.skey[0 ]; -RT_TRACE (_module_rtl871x_recv_c_, _drv_err_, ("\n %s: unicast key\n" , __func__)); +RT_TRACE (_module_rtl871x_recv_c_, _drv_err_, + ("\n %s: unicast key\n" , __func__)); }/* icv_len included the mic code */
@@ -346,7 +352,8 @@ static int recvframe_chkmic(struct adapter *adapter, } } }else { -RT_TRACE (_module_rtl871x_recv_c_, _drv_err_, ("%s: rtw_get_stainfo==NULL!!!\n" , __func__)); +RT_TRACE (_module_rtl871x_recv_c_, _drv_err_, + ("%s: rtw_get_stainfo==NULL!!!\n" , __func__)); }skb_trim (precvframe->pkt, precvframe->pkt->len -8 );
@@ -1011,7 +1018,8 @@ static int validate_recv_mgnt_frame(struct adapter *padapter, precv_frame =recvframe_chk_defrag (padapter, precv_frame);if (precv_frame ==NULL ) { -RT_TRACE (_module_rtl871x_recv_c_, _drv_notice_, ("%s: fragment packet\n" , __func__)); +RT_TRACE (_module_rtl871x_recv_c_, _drv_notice_, + ("%s: fragment packet\n" , __func__));return _SUCCESS; }
Signature · 1 line
2.7.4