Re: [PATCH 01/16] staging: rtl8723bs: remove RT_TRACE logs in core/rtw_xmit.c

2021-04-02 Thread Fabio Aiuto
On Fri, Apr 02, 2021 at 02:47:10PM +0200, Greg KH wrote:
> On Fri, Apr 02, 2021 at 02:40:46PM +0200, Fabio Aiuto wrote:
> > On Fri, Apr 02, 2021 at 02:56:26PM +0300, Dan Carpenter wrote:
> > > On Fri, Apr 02, 2021 at 12:01:21PM +0200, Fabio Aiuto wrote:
> > > > @@ -568,20 +561,11 @@ static s32 update_attrib_sec_info(struct adapter 
> > > > *padapter, struct pkt_attrib *p
> > > > if (pattrib->encrypt > 0)
> > > > memcpy(pattrib->dot118021x_UncstKey.skey, 
> > > > psta->dot118021x_UncstKey.skey, 16);
> > > >  
> > > > -   RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_,
> > > > -   ("update_attrib: encrypt =%d  securitypriv.sw_encrypt 
> > > > =%d\n",
> > > > -   pattrib->encrypt, padapter->securitypriv.sw_encrypt));
> > > > -
> > > > if (pattrib->encrypt &&
> > > > -   ((padapter->securitypriv.sw_encrypt == true) || 
> > > > (psecuritypriv->hw_decrypted == false))) {
> > > > +   ((padapter->securitypriv.sw_encrypt) || 
> > > > (!psecuritypriv->hw_decrypted)))
> > > 
> > > You've done too much clean up here.  Just remove the { but leave the
> > > == true/false comparisons.
> > > 
> > > If the patch is only changing five lines or code then fixing checkpatch
> > > warnings on the line of code you are changing is fine, but in this case
> > > you're doing a bunch of changes and these sort of cleanups make it hard
> > > to review.
> > > 
> > > Ease to spot that the curly brace changed:
> > > - ((padapter->securitypriv.sw_encrypt == true) || 
> > > (psecuritypriv->hw_decrypted == false))) {
> > > + ((padapter->securitypriv.sw_encrypt == true) || 
> > > (psecuritypriv->hw_decrypted == false)))
> > > 
> > > Hard to spot:
> > > - ((padapter->securitypriv.sw_encrypt == true) || 
> > > (psecuritypriv->hw_decrypted == false))) {
> > > + ((padapter->securitypriv.sw_encrypt) || 
> > > (!psecuritypriv->hw_decrypted)))
> > > 
> > > regards,
> > > dan carpenter
> > > 
> > 
> > thank you Dan, it's a good tuning process for me. Shall I resend the
> > whole patchset? Maybe some of them are ok...
> 
> Yes please, you do not want me to pick and choose individual patches out
> of this series.  Our tools grab the whole series at once to apply them.
> 
> thanks,
> 
> greg k-h

ok, got it,

thank you for your patience,:)

fabio


Re: [PATCH 01/16] staging: rtl8723bs: remove RT_TRACE logs in core/rtw_xmit.c

2021-04-02 Thread Greg KH
On Fri, Apr 02, 2021 at 02:40:46PM +0200, Fabio Aiuto wrote:
> On Fri, Apr 02, 2021 at 02:56:26PM +0300, Dan Carpenter wrote:
> > On Fri, Apr 02, 2021 at 12:01:21PM +0200, Fabio Aiuto wrote:
> > > @@ -568,20 +561,11 @@ static s32 update_attrib_sec_info(struct adapter 
> > > *padapter, struct pkt_attrib *p
> > >   if (pattrib->encrypt > 0)
> > >   memcpy(pattrib->dot118021x_UncstKey.skey, 
> > > psta->dot118021x_UncstKey.skey, 16);
> > >  
> > > - RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_,
> > > - ("update_attrib: encrypt =%d  securitypriv.sw_encrypt =%d\n",
> > > - pattrib->encrypt, padapter->securitypriv.sw_encrypt));
> > > -
> > >   if (pattrib->encrypt &&
> > > - ((padapter->securitypriv.sw_encrypt == true) || 
> > > (psecuritypriv->hw_decrypted == false))) {
> > > + ((padapter->securitypriv.sw_encrypt) || 
> > > (!psecuritypriv->hw_decrypted)))
> > 
> > You've done too much clean up here.  Just remove the { but leave the
> > == true/false comparisons.
> > 
> > If the patch is only changing five lines or code then fixing checkpatch
> > warnings on the line of code you are changing is fine, but in this case
> > you're doing a bunch of changes and these sort of cleanups make it hard
> > to review.
> > 
> > Ease to spot that the curly brace changed:
> > -   ((padapter->securitypriv.sw_encrypt == true) || 
> > (psecuritypriv->hw_decrypted == false))) {
> > +   ((padapter->securitypriv.sw_encrypt == true) || 
> > (psecuritypriv->hw_decrypted == false)))
> > 
> > Hard to spot:
> > -   ((padapter->securitypriv.sw_encrypt == true) || 
> > (psecuritypriv->hw_decrypted == false))) {
> > +   ((padapter->securitypriv.sw_encrypt) || 
> > (!psecuritypriv->hw_decrypted)))
> > 
> > regards,
> > dan carpenter
> > 
> 
> thank you Dan, it's a good tuning process for me. Shall I resend the
> whole patchset? Maybe some of them are ok...

Yes please, you do not want me to pick and choose individual patches out
of this series.  Our tools grab the whole series at once to apply them.

thanks,

greg k-h


Re: [PATCH 01/16] staging: rtl8723bs: remove RT_TRACE logs in core/rtw_xmit.c

2021-04-02 Thread Fabio Aiuto
On Fri, Apr 02, 2021 at 02:56:26PM +0300, Dan Carpenter wrote:
> On Fri, Apr 02, 2021 at 12:01:21PM +0200, Fabio Aiuto wrote:
> > @@ -568,20 +561,11 @@ static s32 update_attrib_sec_info(struct adapter 
> > *padapter, struct pkt_attrib *p
> > if (pattrib->encrypt > 0)
> > memcpy(pattrib->dot118021x_UncstKey.skey, 
> > psta->dot118021x_UncstKey.skey, 16);
> >  
> > -   RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_,
> > -   ("update_attrib: encrypt =%d  securitypriv.sw_encrypt =%d\n",
> > -   pattrib->encrypt, padapter->securitypriv.sw_encrypt));
> > -
> > if (pattrib->encrypt &&
> > -   ((padapter->securitypriv.sw_encrypt == true) || 
> > (psecuritypriv->hw_decrypted == false))) {
> > +   ((padapter->securitypriv.sw_encrypt) || 
> > (!psecuritypriv->hw_decrypted)))
> 
> You've done too much clean up here.  Just remove the { but leave the
> == true/false comparisons.
> 
> If the patch is only changing five lines or code then fixing checkpatch
> warnings on the line of code you are changing is fine, but in this case
> you're doing a bunch of changes and these sort of cleanups make it hard
> to review.
> 
> Ease to spot that the curly brace changed:
> - ((padapter->securitypriv.sw_encrypt == true) || 
> (psecuritypriv->hw_decrypted == false))) {
> + ((padapter->securitypriv.sw_encrypt == true) || 
> (psecuritypriv->hw_decrypted == false)))
> 
> Hard to spot:
> - ((padapter->securitypriv.sw_encrypt == true) || 
> (psecuritypriv->hw_decrypted == false))) {
> + ((padapter->securitypriv.sw_encrypt) || 
> (!psecuritypriv->hw_decrypted)))
> 
> regards,
> dan carpenter
> 

thank you Dan, it's a good tuning process for me. Shall I resend the
whole patchset? Maybe some of them are ok...

fabio


Re: [PATCH 01/16] staging: rtl8723bs: remove RT_TRACE logs in core/rtw_xmit.c

2021-04-02 Thread Dan Carpenter
On Fri, Apr 02, 2021 at 12:01:21PM +0200, Fabio Aiuto wrote:
> @@ -568,20 +561,11 @@ static s32 update_attrib_sec_info(struct adapter 
> *padapter, struct pkt_attrib *p
>   if (pattrib->encrypt > 0)
>   memcpy(pattrib->dot118021x_UncstKey.skey, 
> psta->dot118021x_UncstKey.skey, 16);
>  
> - RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_,
> - ("update_attrib: encrypt =%d  securitypriv.sw_encrypt =%d\n",
> - pattrib->encrypt, padapter->securitypriv.sw_encrypt));
> -
>   if (pattrib->encrypt &&
> - ((padapter->securitypriv.sw_encrypt == true) || 
> (psecuritypriv->hw_decrypted == false))) {
> + ((padapter->securitypriv.sw_encrypt) || 
> (!psecuritypriv->hw_decrypted)))

You've done too much clean up here.  Just remove the { but leave the
== true/false comparisons.

If the patch is only changing five lines or code then fixing checkpatch
warnings on the line of code you are changing is fine, but in this case
you're doing a bunch of changes and these sort of cleanups make it hard
to review.

Ease to spot that the curly brace changed:
-   ((padapter->securitypriv.sw_encrypt == true) || 
(psecuritypriv->hw_decrypted == false))) {
+   ((padapter->securitypriv.sw_encrypt == true) || 
(psecuritypriv->hw_decrypted == false)))

Hard to spot:
-   ((padapter->securitypriv.sw_encrypt == true) || 
(psecuritypriv->hw_decrypted == false))) {
+   ((padapter->securitypriv.sw_encrypt) || 
(!psecuritypriv->hw_decrypted)))

regards,
dan carpenter



[PATCH 01/16] staging: rtl8723bs: remove RT_TRACE logs in core/rtw_xmit.c

2021-04-02 Thread Fabio Aiuto
remove all RT_TRACE logs

fix patch-related checkpatch warning

Signed-off-by: Fabio Aiuto 
---
 drivers/staging/rtl8723bs/core/rtw_xmit.c | 82 ++-
 1 file changed, 7 insertions(+), 75 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c 
b/drivers/staging/rtl8723bs/core/rtw_xmit.c
index 2daf5c461a4d..6891fe6563f6 100644
--- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
@@ -69,7 +69,6 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct 
adapter *padapter)
 
if (!pxmitpriv->pallocated_frame_buf) {
pxmitpriv->pxmit_frame_buf = NULL;
-   RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("alloc xmit_frame 
fail!\n"));
res = _FAIL;
goto exit;
}
@@ -105,7 +104,6 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct 
adapter *padapter)
pxmitpriv->pallocated_xmitbuf = vzalloc(NR_XMITBUFF * sizeof(struct 
xmit_buf) + 4);
 
if (!pxmitpriv->pallocated_xmitbuf) {
-   RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("alloc xmit_buf 
fail!\n"));
res = _FAIL;
goto exit;
}
@@ -155,7 +153,6 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct 
adapter *padapter)
 
if (!pxmitpriv->xframe_ext_alloc_addr) {
pxmitpriv->xframe_ext = NULL;
-   RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("alloc xframe_ext 
fail!\n"));
res = _FAIL;
goto exit;
}
@@ -188,7 +185,6 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct 
adapter *padapter)
pxmitpriv->pallocated_xmit_extbuf = vzalloc(NR_XMIT_EXTBUFF * 
sizeof(struct xmit_buf) + 4);
 
if (!pxmitpriv->pallocated_xmit_extbuf) {
-   RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("alloc 
xmit_extbuf fail!\n"));
res = _FAIL;
goto exit;
}
@@ -481,12 +477,9 @@ static s32 update_attrib_sec_info(struct adapter 
*padapter, struct pkt_attrib *p
pattrib->mac_id = psta->mac_id;
 
if (psta->ieee8021x_blocked == true) {
-   RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("\n 
psta->ieee8021x_blocked == true\n"));
-
pattrib->encrypt = 0;
 
if ((pattrib->ether_type != 0x888e) && 
(check_fwstate(pmlmepriv, WIFI_MP_STATE) == false)) {
-   RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, 
("\npsta->ieee8021x_blocked == true,  pattrib->ether_type(%.4x) != 0x888e\n", 
pattrib->ether_type));
#ifdef DBG_TX_DROP_FRAME
DBG_871X("DBG_TX_DROP_FRAME %s psta->ieee8021x_blocked 
== true,  pattrib->ether_type(%04x) != 0x888e\n", __func__, 
pattrib->ether_type);
#endif
@@ -568,20 +561,11 @@ static s32 update_attrib_sec_info(struct adapter 
*padapter, struct pkt_attrib *p
if (pattrib->encrypt > 0)
memcpy(pattrib->dot118021x_UncstKey.skey, 
psta->dot118021x_UncstKey.skey, 16);
 
-   RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_,
-   ("update_attrib: encrypt =%d  securitypriv.sw_encrypt =%d\n",
-   pattrib->encrypt, padapter->securitypriv.sw_encrypt));
-
if (pattrib->encrypt &&
-   ((padapter->securitypriv.sw_encrypt == true) || 
(psecuritypriv->hw_decrypted == false))) {
+   ((padapter->securitypriv.sw_encrypt) || 
(!psecuritypriv->hw_decrypted)))
pattrib->bswenc = true;
-   RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_,
-   ("update_attrib: encrypt =%d securitypriv.hw_decrypted 
=%d bswenc =true\n",
-   pattrib->encrypt, padapter->securitypriv.sw_encrypt));
-   } else {
+   else
pattrib->bswenc = false;
-   RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("update_attrib: 
bswenc =false\n"));
-   }
 
 exit:
 
@@ -685,7 +669,6 @@ static s32 update_attrib(struct adapter *padapter, struct 
sk_buff *pkt, struct p
((tmp[21] == 67) && (tmp[23] == 68))) {
/*  68 : UDP BOOTP client */
/*  67 : UDP BOOTP server */
-   RT_TRACE(_module_rtl871x_xmit_c_, 
_drv_err_, ("==update_attrib: get DHCP Packet\n"));
pattrib->dhcp_pkt = 1;
}
}
@@ -720,7 +703,6 @@ static s32 update_attrib(struct adapter *padapter, struct 
sk_buff *pkt, struct p
} else {
psta = rtw_get_stainfo(pstapriv, pattrib->ra);
if (!psta)  { /*  if we cannot get psta => drop the pkt */
-   RT_TRACE(_module_rtl871x_xmit_c_, _drv_alert_, 
("\nupdate_attrib => get sta_info fail, ra:%pM\n", MAC_ARG(pattrib->ra)));