linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: r8188eu: os_dep: remove the goto statement
@ 2021-10-31 18:10 Saurav Girepunje
  2021-10-31 18:43 ` Pavel Skripkin
  2021-11-01 13:01 ` Greg KH
  0 siblings, 2 replies; 12+ messages in thread
From: Saurav Girepunje @ 2021-10-31 18:10 UTC (permalink / raw)
  To: Larry.Finger, phil, gregkh, straube.linux, martin,
	saurav.girepunje, linux-staging, linux-kernel
  Cc: saurav.girepunje

Remove the goto statement from rtw_init_drv_sw(). In this function goto
can be replace by return statement. As on goto label exit, function
only return it is not performing any cleanup. Avoiding goto will
improve the function readability.

Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
---
 drivers/staging/r8188eu/os_dep/os_intfs.c | 39 +++++++----------------
 1 file changed, 12 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c
index 1418c9c4916c..4b409479108e 100644
--- a/drivers/staging/r8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/r8188eu/os_dep/os_intfs.c
@@ -480,48 +480,34 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
 {
 	u8	ret8 = _SUCCESS;

-	if ((rtw_init_cmd_priv(&padapter->cmdpriv)) == _FAIL) {
-		ret8 = _FAIL;
-		goto exit;
-	}
+	if (!rtw_init_cmd_priv(&padapter->cmdpriv))
+		return _FAIL;

 	padapter->cmdpriv.padapter = padapter;

-	if ((rtw_init_evt_priv(&padapter->evtpriv)) == _FAIL) {
-		ret8 = _FAIL;
-		goto exit;
-	}
-
-	if (rtw_init_mlme_priv(padapter) == _FAIL) {
-		ret8 = _FAIL;
-		goto exit;
-	}
+	if (!rtw_init_evt_priv(&padapter->evtpriv) || !rtw_init_mlme_priv(padapter))
+		return _FAIL;

 	rtw_init_wifidirect_timers(padapter);
 	init_wifidirect_info(padapter, P2P_ROLE_DISABLE);
 	reset_global_wifidirect_info(padapter);

-	if (init_mlme_ext_priv(padapter) == _FAIL) {
-		ret8 = _FAIL;
-		goto exit;
-	}
+	if (!init_mlme_ext_priv(padapter))
+		return _FAIL;

-	if (_rtw_init_xmit_priv(&padapter->xmitpriv, padapter) == _FAIL) {
+	if (!_rtw_init_xmit_priv(&padapter->xmitpriv, padapter)) {
 		DBG_88E("Can't _rtw_init_xmit_priv\n");
-		ret8 = _FAIL;
-		goto exit;
+		return _FAIL;
 	}

-	if (_rtw_init_recv_priv(&padapter->recvpriv, padapter) == _FAIL) {
+	if (!_rtw_init_recv_priv(&padapter->recvpriv, padapter)) {
 		DBG_88E("Can't _rtw_init_recv_priv\n");
-		ret8 = _FAIL;
-		goto exit;
+		return _FAIL;
 	}

-	if (_rtw_init_sta_priv(&padapter->stapriv) == _FAIL) {
+	if (!_rtw_init_sta_priv(&padapter->stapriv)) {
 		DBG_88E("Can't _rtw_init_sta_priv\n");
-		ret8 = _FAIL;
-		goto exit;
+		return _FAIL;
 	}

 	padapter->stapriv.padapter = padapter;
@@ -539,7 +525,6 @@ u8 rtw_init_drv_sw(struct adapter *padapter)

 	spin_lock_init(&padapter->br_ext_lock);

-exit:
 	return ret8;
 }

--
2.33.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] staging: r8188eu: os_dep: remove the goto statement
  2021-10-31 18:10 [PATCH] staging: r8188eu: os_dep: remove the goto statement Saurav Girepunje
@ 2021-10-31 18:43 ` Pavel Skripkin
  2021-10-31 19:17   ` Joe Perches
  2021-10-31 19:17   ` Saurav Girepunje
  2021-11-01 13:01 ` Greg KH
  1 sibling, 2 replies; 12+ messages in thread
From: Pavel Skripkin @ 2021-10-31 18:43 UTC (permalink / raw)
  To: Saurav Girepunje, Larry.Finger, phil, gregkh, straube.linux,
	martin, linux-staging, linux-kernel
  Cc: saurav.girepunje

On 10/31/21 21:10, Saurav Girepunje wrote:
> Remove the goto statement from rtw_init_drv_sw(). In this function goto
> can be replace by return statement. As on goto label exit, function
> only return it is not performing any cleanup. Avoiding goto will
> improve the function readability.
> 
> Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
> ---
>   drivers/staging/r8188eu/os_dep/os_intfs.c | 39 +++++++----------------
>   1 file changed, 12 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c
> index 1418c9c4916c..4b409479108e 100644
> --- a/drivers/staging/r8188eu/os_dep/os_intfs.c
> +++ b/drivers/staging/r8188eu/os_dep/os_intfs.c
> @@ -480,48 +480,34 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
>   {
>   	u8	ret8 = _SUCCESS;
> 


Btw, this variable can be removed completely then. It's used only for:

ret8 = rtw_init_default_value(padapter);

with your patch applied, but rtw_init_default_value() always returns 
_SUCCESS.


> -exit:
>  	return ret8;
>  }


And just `return _SUCCESS;` here.



With regards,
Pavel Skripkin

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] staging: r8188eu: os_dep: remove the goto statement
  2021-10-31 18:43 ` Pavel Skripkin
@ 2021-10-31 19:17   ` Joe Perches
  2021-11-01  4:28     ` Saurav Girepunje
  2021-10-31 19:17   ` Saurav Girepunje
  1 sibling, 1 reply; 12+ messages in thread
From: Joe Perches @ 2021-10-31 19:17 UTC (permalink / raw)
  To: Pavel Skripkin, Saurav Girepunje, Larry.Finger, phil, gregkh,
	straube.linux, martin, linux-staging, linux-kernel
  Cc: saurav.girepunje

On Sun, 2021-10-31 at 21:43 +0300, Pavel Skripkin wrote:
> On 10/31/21 21:10, Saurav Girepunje wrote:
> > Remove the goto statement from rtw_init_drv_sw(). In this function goto
> > can be replace by return statement. As on goto label exit, function
> > only return it is not performing any cleanup. Avoiding goto will
> > improve the function readability.
[]
> > diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c
[]
> > @@ -480,48 +480,34 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
> >   {
> >   	u8	ret8 = _SUCCESS;
> 
> Btw, this variable can be removed completely then. It's used only for:
> 
> ret8 = rtw_init_default_value(padapter);
> 
> with your patch applied, but rtw_init_default_value() always returns 
> _SUCCESS.
> 
> > -exit:
> >  	return ret8;
> >  }
> 
> And just `return _SUCCESS;` here.

And maybe one day s/_SUCCESS/true/ and s/_FAIL/false/
with appropriate conversions to bool



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] staging: r8188eu: os_dep: remove the goto statement
  2021-10-31 18:43 ` Pavel Skripkin
  2021-10-31 19:17   ` Joe Perches
@ 2021-10-31 19:17   ` Saurav Girepunje
  2021-10-31 19:24     ` Pavel Skripkin
  1 sibling, 1 reply; 12+ messages in thread
From: Saurav Girepunje @ 2021-10-31 19:17 UTC (permalink / raw)
  To: Pavel Skripkin, Larry.Finger, phil, gregkh, straube.linux,
	martin, linux-staging, linux-kernel
  Cc: saurav.girepunje



On 01/11/21 12:13 am, Pavel Skripkin wrote:
> On 10/31/21 21:10, Saurav Girepunje wrote:
>> Remove the goto statement from rtw_init_drv_sw(). In this function goto
>> can be replace by return statement. As on goto label exit, function
>> only return it is not performing any cleanup. Avoiding goto will
>> improve the function readability.
>>
>> Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
>> ---
>>   drivers/staging/r8188eu/os_dep/os_intfs.c | 39 +++++++----------------
>>   1 file changed, 12 insertions(+), 27 deletions(-)
>>
>> diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c
>> index 1418c9c4916c..4b409479108e 100644
>> --- a/drivers/staging/r8188eu/os_dep/os_intfs.c
>> +++ b/drivers/staging/r8188eu/os_dep/os_intfs.c
>> @@ -480,48 +480,34 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
>>   {
>>       u8    ret8 = _SUCCESS;
>>
> 
> 
> Btw, this variable can be removed completely then. It's used only for:
> 
> ret8 = rtw_init_default_value(padapter);
> 
> with your patch applied, but rtw_init_default_value() always returns _SUCCESS.
> 
I think rtw_init_default_value should return void. It's return value is not useful.
> 
>> -exit:
>>      return ret8;
>>  }
> 
> 
> And just `return _SUCCESS;` here.
> 
However rtw_init_drv_sw should return _SUCCESS here.
> 
> With regards,
> Pavel Skripkin


Regards,
Saurav 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] staging: r8188eu: os_dep: remove the goto statement
  2021-10-31 19:17   ` Saurav Girepunje
@ 2021-10-31 19:24     ` Pavel Skripkin
  2021-10-31 19:27       ` Pavel Skripkin
  0 siblings, 1 reply; 12+ messages in thread
From: Pavel Skripkin @ 2021-10-31 19:24 UTC (permalink / raw)
  To: Saurav Girepunje, Larry.Finger, phil, gregkh, straube.linux,
	martin, linux-staging, linux-kernel
  Cc: saurav.girepunje

On 10/31/21 22:17, Saurav Girepunje wrote:
> 
> 
> On 01/11/21 12:13 am, Pavel Skripkin wrote:
>> On 10/31/21 21:10, Saurav Girepunje wrote:
>>> Remove the goto statement from rtw_init_drv_sw(). In this function goto
>>> can be replace by return statement. As on goto label exit, function
>>> only return it is not performing any cleanup. Avoiding goto will
>>> improve the function readability.
>>>
>>> Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
>>> ---
>>>   drivers/staging/r8188eu/os_dep/os_intfs.c | 39 +++++++----------------
>>>   1 file changed, 12 insertions(+), 27 deletions(-)
>>>
>>> diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c
>>> index 1418c9c4916c..4b409479108e 100644
>>> --- a/drivers/staging/r8188eu/os_dep/os_intfs.c
>>> +++ b/drivers/staging/r8188eu/os_dep/os_intfs.c
>>> @@ -480,48 +480,34 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
>>>   {
>>>       u8    ret8 = _SUCCESS;
>>>
>> 
>> 
>> Btw, this variable can be removed completely then. It's used only for:
>> 
>> ret8 = rtw_init_default_value(padapter);
>> 
>> with your patch applied, but rtw_init_default_value() always returns _SUCCESS.
>> 
> I think rtw_init_default_value should return void. It's return value is not useful.


Sure, but you need to firstly remove
`ret8 = rtw_init_default_value(padapter);` and then make it return bool 
to not break the build.


With regards,
Pavel Skripkin

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] staging: r8188eu: os_dep: remove the goto statement
  2021-10-31 19:24     ` Pavel Skripkin
@ 2021-10-31 19:27       ` Pavel Skripkin
  2021-11-02 16:40         ` Saurav Girepunje
  0 siblings, 1 reply; 12+ messages in thread
From: Pavel Skripkin @ 2021-10-31 19:27 UTC (permalink / raw)
  To: Saurav Girepunje, Larry.Finger, phil, gregkh, straube.linux,
	martin, linux-staging, linux-kernel
  Cc: saurav.girepunje

On 10/31/21 22:24, Pavel Skripkin wrote:
>> I think rtw_init_default_value should return void. It's return value is not useful.
> 
> 
> Sure, but you need to firstly remove
> `ret8 = rtw_init_default_value(padapter);` and then make it return bool
								     ^^^^

I mean void, of course :)


With regards,
Pavel Skripkin

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] staging: r8188eu: os_dep: remove the goto statement
  2021-10-31 19:17   ` Joe Perches
@ 2021-11-01  4:28     ` Saurav Girepunje
  2021-11-01  4:31       ` Joe Perches
  0 siblings, 1 reply; 12+ messages in thread
From: Saurav Girepunje @ 2021-11-01  4:28 UTC (permalink / raw)
  To: Joe Perches, Pavel Skripkin, Larry.Finger, phil, gregkh,
	straube.linux, martin, linux-staging, linux-kernel
  Cc: saurav.girepunje



On 01/11/21 12:47 am, Joe Perches wrote:
> On Sun, 2021-10-31 at 21:43 +0300, Pavel Skripkin wrote:
>> On 10/31/21 21:10, Saurav Girepunje wrote:
>>> Remove the goto statement from rtw_init_drv_sw(). In this function goto
>>> can be replace by return statement. As on goto label exit, function
>>> only return it is not performing any cleanup. Avoiding goto will
>>> improve the function readability.
> []
>>> diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c
> []
>>> @@ -480,48 +480,34 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
>>>   {
>>>   	u8	ret8 = _SUCCESS;
>>
>> Btw, this variable can be removed completely then. It's used only for:
>>
>> ret8 = rtw_init_default_value(padapter);
>>
>> with your patch applied, but rtw_init_default_value() always returns 
>> _SUCCESS.
>>
>>> -exit:
>>>  	return ret8;
>>>  }
>>
>> And just `return _SUCCESS;` here.
> 
> And maybe one day s/_SUCCESS/true/ and s/_FAIL/false/
> with appropriate conversions to bool
> 
> 

Yes this is another improvement possible on this function.

Regards,
Saurav

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] staging: r8188eu: os_dep: remove the goto statement
  2021-11-01  4:28     ` Saurav Girepunje
@ 2021-11-01  4:31       ` Joe Perches
  0 siblings, 0 replies; 12+ messages in thread
From: Joe Perches @ 2021-11-01  4:31 UTC (permalink / raw)
  To: Saurav Girepunje, Pavel Skripkin, Larry.Finger, phil, gregkh,
	straube.linux, martin, linux-staging, linux-kernel
  Cc: saurav.girepunje

On Mon, 2021-11-01 at 09:58 +0530, Saurav Girepunje wrote:
> On 01/11/21 12:47 am, Joe Perches wrote:
> > On Sun, 2021-10-31 at 21:43 +0300, Pavel Skripkin wrote:
> > > On 10/31/21 21:10, Saurav Girepunje wrote:
> > > > Remove the goto statement from rtw_init_drv_sw(). In this function goto
> > > > can be replace by return statement. As on goto label exit, function
> > > > only return it is not performing any cleanup. Avoiding goto will
> > > > improve the function readability.
[]
> > > And just `return _SUCCESS;` here.
> > 
> > And maybe one day s/_SUCCESS/true/ and s/_FAIL/false/
> > with appropriate conversions to bool
> 
> Yes this is another improvement possible on this function.

Not just this function, globally in the driver.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] staging: r8188eu: os_dep: remove the goto statement
  2021-10-31 18:10 [PATCH] staging: r8188eu: os_dep: remove the goto statement Saurav Girepunje
  2021-10-31 18:43 ` Pavel Skripkin
@ 2021-11-01 13:01 ` Greg KH
  2021-11-02 16:30   ` Saurav Girepunje
  1 sibling, 1 reply; 12+ messages in thread
From: Greg KH @ 2021-11-01 13:01 UTC (permalink / raw)
  To: Saurav Girepunje
  Cc: Larry.Finger, phil, straube.linux, martin, linux-staging,
	linux-kernel, saurav.girepunje

On Sun, Oct 31, 2021 at 11:40:18PM +0530, Saurav Girepunje wrote:
> Remove the goto statement from rtw_init_drv_sw(). In this function goto
> can be replace by return statement. As on goto label exit, function
> only return it is not performing any cleanup. Avoiding goto will
> improve the function readability.
> 
> Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
> ---
>  drivers/staging/r8188eu/os_dep/os_intfs.c | 39 +++++++----------------
>  1 file changed, 12 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c
> index 1418c9c4916c..4b409479108e 100644
> --- a/drivers/staging/r8188eu/os_dep/os_intfs.c
> +++ b/drivers/staging/r8188eu/os_dep/os_intfs.c
> @@ -480,48 +480,34 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
>  {
>  	u8	ret8 = _SUCCESS;
> 
> -	if ((rtw_init_cmd_priv(&padapter->cmdpriv)) == _FAIL) {
> -		ret8 = _FAIL;
> -		goto exit;
> -	}
> +	if (!rtw_init_cmd_priv(&padapter->cmdpriv))
> +		return _FAIL;
> 
>  	padapter->cmdpriv.padapter = padapter;
> 
> -	if ((rtw_init_evt_priv(&padapter->evtpriv)) == _FAIL) {
> -		ret8 = _FAIL;
> -		goto exit;
> -	}
> -
> -	if (rtw_init_mlme_priv(padapter) == _FAIL) {
> -		ret8 = _FAIL;
> -		goto exit;
> -	}
> +	if (!rtw_init_evt_priv(&padapter->evtpriv) || !rtw_init_mlme_priv(padapter))
> +		return _FAIL;

These are functions that are being called so keeping them separate as
the code you removed did makes it "obvious" what is happening here.

So can you keep it that way please?

But my larger question is do these functions create state or allocate
memory that needs to be unwound properly if an error does happen?  Right
now the function seems to not be doing that at all, but that does not
mean it is correct as-is...

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] staging: r8188eu: os_dep: remove the goto statement
  2021-11-01 13:01 ` Greg KH
@ 2021-11-02 16:30   ` Saurav Girepunje
  0 siblings, 0 replies; 12+ messages in thread
From: Saurav Girepunje @ 2021-11-02 16:30 UTC (permalink / raw)
  To: Greg KH
  Cc: Larry.Finger, phil, straube.linux, martin, linux-staging,
	linux-kernel, saurav.girepunje



On 01/11/21 6:31 pm, Greg KH wrote:
> On Sun, Oct 31, 2021 at 11:40:18PM +0530, Saurav Girepunje wrote:
>> Remove the goto statement from rtw_init_drv_sw(). In this function goto
>> can be replace by return statement. As on goto label exit, function
>> only return it is not performing any cleanup. Avoiding goto will
>> improve the function readability.
>>
>> Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
>> ---
>>  drivers/staging/r8188eu/os_dep/os_intfs.c | 39 +++++++----------------
>>  1 file changed, 12 insertions(+), 27 deletions(-)
>>
>> diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c
>> index 1418c9c4916c..4b409479108e 100644
>> --- a/drivers/staging/r8188eu/os_dep/os_intfs.c
>> +++ b/drivers/staging/r8188eu/os_dep/os_intfs.c
>> @@ -480,48 +480,34 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
>>  {
>>  	u8	ret8 = _SUCCESS;
>>
>> -	if ((rtw_init_cmd_priv(&padapter->cmdpriv)) == _FAIL) {
>> -		ret8 = _FAIL;
>> -		goto exit;
>> -	}
>> +	if (!rtw_init_cmd_priv(&padapter->cmdpriv))
>> +		return _FAIL;
>>
>>  	padapter->cmdpriv.padapter = padapter;
>>
>> -	if ((rtw_init_evt_priv(&padapter->evtpriv)) == _FAIL) {
>> -		ret8 = _FAIL;
>> -		goto exit;
>> -	}
>> -
>> -	if (rtw_init_mlme_priv(padapter) == _FAIL) {
>> -		ret8 = _FAIL;
>> -		goto exit;
>> -	}
>> +	if (!rtw_init_evt_priv(&padapter->evtpriv) || !rtw_init_mlme_priv(padapter))
>> +		return _FAIL;
> 
> These are functions that are being called so keeping them separate as
> the code you removed did makes it "obvious" what is happening here.
> 
> So can you keep it that way please?
> 
I will make them separate as they were.

> But my larger question is do these functions create state or allocate
> memory that needs to be unwound properly if an error does happen?  Right
> now the function seems to not be doing that at all, but that does not
> mean it is correct as-is...
> 
> thanks,
> 
> greg k-h
> Regards,
Saurav


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] staging: r8188eu: os_dep: remove the goto statement
  2021-10-31 19:27       ` Pavel Skripkin
@ 2021-11-02 16:40         ` Saurav Girepunje
  2021-11-02 20:20           ` Pavel Skripkin
  0 siblings, 1 reply; 12+ messages in thread
From: Saurav Girepunje @ 2021-11-02 16:40 UTC (permalink / raw)
  To: Pavel Skripkin, Larry.Finger, phil, gregkh, straube.linux,
	martin, linux-staging, linux-kernel
  Cc: saurav.girepunje



On 01/11/21 12:57 am, Pavel Skripkin wrote:
> On 10/31/21 22:24, Pavel Skripkin wrote:
>>> I think rtw_init_default_value should return void. It's return value is not useful.
>>
>>
>> Sure, but you need to firstly remove
>> `ret8 = rtw_init_default_value(padapter);` and then make it return bool
>                                      ^^^^
> 
> I mean void, of course :)
> 
> 
> With regards,
> Pavel Skripkin

Intention for this patch to remove the goto statement. I think removing a local variable
for return value and changing the return type of function can be one separate patch.

On this patch intent to remove the goto statement only.


Regards,
Saurav

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] staging: r8188eu: os_dep: remove the goto statement
  2021-11-02 16:40         ` Saurav Girepunje
@ 2021-11-02 20:20           ` Pavel Skripkin
  0 siblings, 0 replies; 12+ messages in thread
From: Pavel Skripkin @ 2021-11-02 20:20 UTC (permalink / raw)
  To: Saurav Girepunje, Larry.Finger, phil, gregkh, straube.linux,
	martin, linux-staging, linux-kernel
  Cc: saurav.girepunje

On 11/2/21 19:40, Saurav Girepunje wrote:
> 
> 
> On 01/11/21 12:57 am, Pavel Skripkin wrote:
>> On 10/31/21 22:24, Pavel Skripkin wrote:
>>>> I think rtw_init_default_value should return void. It's return value is not useful.
>>>
>>>
>>> Sure, but you need to firstly remove
>>> `ret8 = rtw_init_default_value(padapter);` and then make it return bool
>>                                      ^^^^
>> 
>> I mean void, of course :)
>> 
>> 
>> With regards,
>> Pavel Skripkin
> 
> Intention for this patch to remove the goto statement. I think removing a local variable
> for return value and changing the return type of function can be one separate patch.
> 
> On this patch intent to remove the goto statement only.
> 

I agree, I've just pointed out to further possible code improvements :)



With regards,
Pavel Skripkin

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-11-02 20:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-31 18:10 [PATCH] staging: r8188eu: os_dep: remove the goto statement Saurav Girepunje
2021-10-31 18:43 ` Pavel Skripkin
2021-10-31 19:17   ` Joe Perches
2021-11-01  4:28     ` Saurav Girepunje
2021-11-01  4:31       ` Joe Perches
2021-10-31 19:17   ` Saurav Girepunje
2021-10-31 19:24     ` Pavel Skripkin
2021-10-31 19:27       ` Pavel Skripkin
2021-11-02 16:40         ` Saurav Girepunje
2021-11-02 20:20           ` Pavel Skripkin
2021-11-01 13:01 ` Greg KH
2021-11-02 16:30   ` Saurav Girepunje

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).