[1/3] staging: rtl8723bs: fix white space warnings

Message ID 45558673b486808e7978e2e4838c6ce5a2485b8b.1666230736.git.eperi1024@gmail.com
State New
Headers
Series staging: rtl8723bs: clean up driver code in rtw_ioctl_set |

Commit Message

Emily Peri Oct. 20, 2022, 2:10 a.m. UTC
  Fix the following checkpatch warnings in rtw_ioctl_set:
1) Add missing blankline after declaration
2) Replace spaces used for indent with tab
3) Remove space before tab

Signed-off-by: Emily Peri <eperi1024@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_ioctl_set.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
  

Comments

Praveen Kumar Oct. 20, 2022, 4:04 a.m. UTC | #1
On 20-10-2022 07:40, Emily Peri wrote:
> Fix the following checkpatch warnings in rtw_ioctl_set:
> 1) Add missing blankline after declaration
> 2) Replace spaces used for indent with tab
> 3) Remove space before tab
> 
> Signed-off-by: Emily Peri <eperi1024@gmail.com>
> ---
>  drivers/staging/rtl8723bs/core/rtw_ioctl_set.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
> index 8c11daff2d59..354e61a8f2bd 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
> @@ -78,6 +78,7 @@ u8 rtw_do_join(struct adapter *padapter)
>  		goto exit;
>  	} else {
>  		int select_ret;
> +
>  		spin_unlock_bh(&(pmlmepriv->scanned_queue.lock));
>  		select_ret = rtw_select_and_join_from_scanned_queue(pmlmepriv);
>  		if (select_ret == _SUCCESS) {
> @@ -311,7 +312,7 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter,
>  		if ((*pold_state == Ndis802_11Infrastructure) || (*pold_state == Ndis802_11IBSS)) {
>  			if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
>  				rtw_indicate_disconnect(padapter); /* will clr Linked_state; before this function, we must have checked whether issue dis-assoc_cmd or not */
> -	       }
> +		}

I think indentation is wrong here, it should be only 1 tab instead of 2 tabs ?

>  
>  		*pold_state = networktype;
>  
> @@ -367,7 +368,7 @@ u8 rtw_set_802_11_disassociate(struct adapter *padapter)
>  
>  u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_ssid *pssid, int ssid_max_num)
>  {
> -	struct	mlme_priv 	*pmlmepriv = &padapter->mlmepriv;
> +	struct	mlme_priv	*pmlmepriv = &padapter->mlmepriv;
>  	u8 res = true;
>  
>  	if (!padapter) {

Regards,

~Praveen.
  
Greg KH Oct. 20, 2022, 4:57 a.m. UTC | #2
On Wed, Oct 19, 2022 at 07:10:51PM -0700, Emily Peri wrote:
> Fix the following checkpatch warnings in rtw_ioctl_set:
> 1) Add missing blankline after declaration
> 2) Replace spaces used for indent with tab
> 3) Remove space before tab

When you have to list the different things you do, you should really
break that up into individual patches.  This should be 3.

thanks,

greg k-h
  
Emily Peri Oct. 20, 2022, 5:05 a.m. UTC | #3
On Thu, Oct 20, 2022 at 09:34:07AM +0530, Praveen Kumar wrote:
> On 20-10-2022 07:40, Emily Peri wrote:
> > Fix the following checkpatch warnings in rtw_ioctl_set:
> > 1) Add missing blankline after declaration
> > 2) Replace spaces used for indent with tab
> > 3) Remove space before tab
> > 
> > Signed-off-by: Emily Peri <eperi1024@gmail.com>
> > ---
> >  drivers/staging/rtl8723bs/core/rtw_ioctl_set.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
> > index 8c11daff2d59..354e61a8f2bd 100644
> > --- a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
> > +++ b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
> > @@ -78,6 +78,7 @@ u8 rtw_do_join(struct adapter *padapter)
> >  		goto exit;
> >  	} else {
> >  		int select_ret;
> > +
> >  		spin_unlock_bh(&(pmlmepriv->scanned_queue.lock));
> >  		select_ret = rtw_select_and_join_from_scanned_queue(pmlmepriv);
> >  		if (select_ret == _SUCCESS) {
> > @@ -311,7 +312,7 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter,
> >  		if ((*pold_state == Ndis802_11Infrastructure) || (*pold_state == Ndis802_11IBSS)) {
> >  			if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
> >  				rtw_indicate_disconnect(padapter); /* will clr Linked_state; before this function, we must have checked whether issue dis-assoc_cmd or not */
> > -	       }
> > +		}
> 
> I think indentation is wrong here, it should be only 1 tab instead of 2 tabs ?

Thanks Praveen for the feedback! But I think this if-statement is nested inside
another one beginning at line 295. Can you confirm?


> >  
> >  		*pold_state = networktype;
> >  
> > @@ -367,7 +368,7 @@ u8 rtw_set_802_11_disassociate(struct adapter *padapter)
> >  
> >  u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_ssid *pssid, int ssid_max_num)
> >  {
> > -	struct	mlme_priv 	*pmlmepriv = &padapter->mlmepriv;
> > +	struct	mlme_priv	*pmlmepriv = &padapter->mlmepriv;
> >  	u8 res = true;
> >  
> >  	if (!padapter) {
> 
> Regards,
> 
> ~Praveen.

Now that I think about-- in this last edit I removed a space to appease
checkpatch, but maybe I actually should have removed the tab?

Thanks!
Emily
  
Emily Peri Oct. 20, 2022, 5:28 a.m. UTC | #4
On Thu, Oct 20, 2022 at 06:57:03AM +0200, Greg KH wrote:
> On Wed, Oct 19, 2022 at 07:10:51PM -0700, Emily Peri wrote:
> > Fix the following checkpatch warnings in rtw_ioctl_set:
> > 1) Add missing blankline after declaration
> > 2) Replace spaces used for indent with tab
> > 3) Remove space before tab
> 
> When you have to list the different things you do, you should really
> break that up into individual patches.  This should be 3.
> 
> thanks,
> 
> greg k-h

Thanks greg for the feedback! I got the idea to put them all in the same
patch from the PatchPhilosophy guide, which suggested combining a bunch
of white space corrections into one commit. But, it sounds like I
misinterpreted what the guide was saying. Maybe if there are identical
warnings, such as "trailing white space" in the driver code, could those
corrections go together in a single patch?
  
Michael Straube Oct. 20, 2022, 5:59 a.m. UTC | #5
On 10/20/22 07:05, Emily Peri wrote:
>>>   
>>>   		*pold_state = networktype;
>>>   
>>> @@ -367,7 +368,7 @@ u8 rtw_set_802_11_disassociate(struct adapter *padapter)
>>>   
>>>   u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_ssid *pssid, int ssid_max_num)
>>>   {
>>> -	struct	mlme_priv 	*pmlmepriv = &padapter->mlmepriv;
>>> +	struct	mlme_priv	*pmlmepriv = &padapter->mlmepriv;
>>>   	u8 res = true;
>>>   
>>>   	if (!padapter) {
>>
>> Regards,
>>
>> ~Praveen.
> 
> Now that I think about-- in this last edit I removed a space to appease
> checkpatch, but maybe I actually should have removed the tab?

Hi Emily,

you are right, just use spaces.

struct mlme_priv *pmlmepriv = &padapter->mlmepriv;

thanks,
Michael
  
Greg KH Oct. 20, 2022, 7:07 a.m. UTC | #6
On Wed, Oct 19, 2022 at 10:28:42PM -0700, Emily Peri wrote:
> On Thu, Oct 20, 2022 at 06:57:03AM +0200, Greg KH wrote:
> > On Wed, Oct 19, 2022 at 07:10:51PM -0700, Emily Peri wrote:
> > > Fix the following checkpatch warnings in rtw_ioctl_set:
> > > 1) Add missing blankline after declaration
> > > 2) Replace spaces used for indent with tab
> > > 3) Remove space before tab
> > 
> > When you have to list the different things you do, you should really
> > break that up into individual patches.  This should be 3.
> > 
> > thanks,
> > 
> > greg k-h
> 
> Thanks greg for the feedback! I got the idea to put them all in the same
> patch from the PatchPhilosophy guide, which suggested combining a bunch
> of white space corrections into one commit. But, it sounds like I
> misinterpreted what the guide was saying. Maybe if there are identical
> warnings, such as "trailing white space" in the driver code, could those
> corrections go together in a single patch?
> 

Yes, you are correct, you could do a "fix all trailing whitespace in
this file" in one patch.

thanks,

greg k-h
  

Patch

diff --git a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
index 8c11daff2d59..354e61a8f2bd 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
@@ -78,6 +78,7 @@  u8 rtw_do_join(struct adapter *padapter)
 		goto exit;
 	} else {
 		int select_ret;
+
 		spin_unlock_bh(&(pmlmepriv->scanned_queue.lock));
 		select_ret = rtw_select_and_join_from_scanned_queue(pmlmepriv);
 		if (select_ret == _SUCCESS) {
@@ -311,7 +312,7 @@  u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter,
 		if ((*pold_state == Ndis802_11Infrastructure) || (*pold_state == Ndis802_11IBSS)) {
 			if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
 				rtw_indicate_disconnect(padapter); /* will clr Linked_state; before this function, we must have checked whether issue dis-assoc_cmd or not */
-	       }
+		}
 
 		*pold_state = networktype;
 
@@ -367,7 +368,7 @@  u8 rtw_set_802_11_disassociate(struct adapter *padapter)
 
 u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_ssid *pssid, int ssid_max_num)
 {
-	struct	mlme_priv 	*pmlmepriv = &padapter->mlmepriv;
+	struct	mlme_priv	*pmlmepriv = &padapter->mlmepriv;
 	u8 res = true;
 
 	if (!padapter) {