2021-10-25 13:53:56

by Saurav Girepunje

[permalink] [raw]
Subject: [PATCH] staging: r8188eu: core: remove goto statement

Remove the goto statement from rtw_do_join(). 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 <[email protected]>
---
drivers/staging/r8188eu/core/rtw_ioctl_set.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_ioctl_set.c b/drivers/staging/r8188eu/core/rtw_ioctl_set.c
index 2b54cdfa9d6e..411b06e135be 100644
--- a/drivers/staging/r8188eu/core/rtw_ioctl_set.c
+++ b/drivers/staging/r8188eu/core/rtw_ioctl_set.c
@@ -51,7 +51,7 @@ u8 rtw_do_join(struct adapter *padapter)
ret = _FAIL;
}

- goto exit;
+ return ret;
} else {
int select_ret;

@@ -78,10 +78,9 @@ u8 rtw_do_join(struct adapter *padapter)

rtw_generate_random_ibss(pibss);

- if (rtw_createbss_cmd(padapter) != _SUCCESS) {
- ret = false;
- goto exit;
- }
+ if (rtw_createbss_cmd(padapter) != _SUCCESS)
+ return false;
+
pmlmepriv->to_join = false;
} else {
/* can't associate ; reset under-linking */
@@ -102,8 +101,6 @@ u8 rtw_do_join(struct adapter *padapter)
}
}

-exit:
-
return ret;
}

--
2.33.0


2021-10-25 15:18:48

by Larry Finger

[permalink] [raw]
Subject: Re: [PATCH] staging: r8188eu: core: remove goto statement

On 10/25/21 07:15, Saurav Girepunje wrote:
> Remove the goto statement from rtw_do_join(). 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 <[email protected]>
> ---

You need to read section 14 of Documentation/process/submitting-patches.rst to
learn how to submit a revised patch. Resubmitting such a revision using the same
subject line is likely to confuse reviewers and maintainers alike, if not
patchworks.

Larry

> drivers/staging/r8188eu/core/rtw_ioctl_set.c | 11 ++++-------
> 1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/core/rtw_ioctl_set.c b/drivers/staging/r8188eu/core/rtw_ioctl_set.c
> index 2b54cdfa9d6e..411b06e135be 100644
> --- a/drivers/staging/r8188eu/core/rtw_ioctl_set.c
> +++ b/drivers/staging/r8188eu/core/rtw_ioctl_set.c
> @@ -51,7 +51,7 @@ u8 rtw_do_join(struct adapter *padapter)
> ret = _FAIL;
> }
>
> - goto exit;
> + return ret;
> } else {
> int select_ret;
>
> @@ -78,10 +78,9 @@ u8 rtw_do_join(struct adapter *padapter)
>
> rtw_generate_random_ibss(pibss);
>
> - if (rtw_createbss_cmd(padapter) != _SUCCESS) {
> - ret = false;
> - goto exit;
> - }
> + if (rtw_createbss_cmd(padapter) != _SUCCESS)
> + return false;
> +
> pmlmepriv->to_join = false;
> } else {
> /* can't associate ; reset under-linking */
> @@ -102,8 +101,6 @@ u8 rtw_do_join(struct adapter *padapter)
> }
> }
>
> -exit:
> -
> return ret;
> }
>
> --
> 2.33.0
>

2021-10-25 17:08:23

by Saurav Girepunje

[permalink] [raw]
Subject: Re: [PATCH] staging: r8188eu: core: remove goto statement



On 25/10/21 8:45 pm, Larry Finger wrote:
> On 10/25/21 07:15, Saurav Girepunje wrote:
>> Remove the goto statement from rtw_do_join(). 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 <[email protected]>
>> ---
>
Hi Larry,

> You need to read section 14 of Documentation/process/submitting-patches.rst to learn how to submit a revised patch.
Resubmitting such a revision using the same subject line is likely to confuse reviewers and maintainers alike, if not patchworks.
>
This is original patch (v1). I haven't get any review comment for this patch.

> Larry

Regards,
Saurav
>
>>   drivers/staging/r8188eu/core/rtw_ioctl_set.c | 11 ++++-------
>>   1 file changed, 4 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/staging/r8188eu/core/rtw_ioctl_set.c b/drivers/staging/r8188eu/core/rtw_ioctl_set.c
>> index 2b54cdfa9d6e..411b06e135be 100644
>> --- a/drivers/staging/r8188eu/core/rtw_ioctl_set.c
>> +++ b/drivers/staging/r8188eu/core/rtw_ioctl_set.c
>> @@ -51,7 +51,7 @@ u8 rtw_do_join(struct adapter *padapter)
>>               ret = _FAIL;
>>           }
>>
>> -        goto exit;
>> +        return ret;
>>       } else {
>>           int select_ret;
>>
>> @@ -78,10 +78,9 @@ u8 rtw_do_join(struct adapter *padapter)
>>
>>                   rtw_generate_random_ibss(pibss);
>>
>> -                if (rtw_createbss_cmd(padapter) != _SUCCESS) {
>> -                    ret =  false;
>> -                    goto exit;
>> -                }
>> +                if (rtw_createbss_cmd(padapter) != _SUCCESS)
>> +                    return false;
>> +
>>                   pmlmepriv->to_join = false;
>>               } else {
>>                   /*  can't associate ; reset under-linking */
>> @@ -102,8 +101,6 @@ u8 rtw_do_join(struct adapter *padapter)
>>           }
>>       }
>>
>> -exit:
>> -
>>       return ret;
>>   }
>>
>> --
>> 2.33.0
>>
>

2021-10-25 17:29:50

by Larry Finger

[permalink] [raw]
Subject: Re: [PATCH] staging: r8188eu: core: remove goto statement

On 10/25/21 12:00, Saurav Girepunje wrote:
>
>
> On 25/10/21 8:45 pm, Larry Finger wrote:
>> On 10/25/21 07:15, Saurav Girepunje wrote:
>>> Remove the goto statement from rtw_do_join(). 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 <[email protected]>
>>> ---
>>
> Hi Larry,
>
>> You need to read section 14 of Documentation/process/submitting-patches.rst to learn how to submit a revised patch.
> Resubmitting such a revision using the same subject line is likely to confuse reviewers and maintainers alike, if not patchworks.
>>
> This is original patch (v1). I haven't get any review comment for this patch.

Why did I get it twice? At least I got two messages with that subject line.

Larry

2021-10-25 17:49:32

by Saurav Girepunje

[permalink] [raw]
Subject: Re: [PATCH] staging: r8188eu: core: remove goto statement



On 25/10/21 10:56 pm, Larry Finger wrote:
> On 10/25/21 12:00, Saurav Girepunje wrote:
>>
>>
>> On 25/10/21 8:45 pm, Larry Finger wrote:
>>> On 10/25/21 07:15, Saurav Girepunje wrote:
>>>> Remove the goto statement from rtw_do_join(). 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 <[email protected]>
>>>> ---
>>>
>> Hi Larry,
>>  
>>> You need to read section 14 of Documentation/process/submitting-patches.rst to learn how to submit a revised patch.
>> Resubmitting such a revision using the same subject line is likely to confuse reviewers and maintainers alike, if not patchworks.
>>>
>> This is original patch (v1). I haven't get any review comment for this patch.
>
> Why did I get it twice? At least I got two messages with that subject line.
>
> Larry

I checked on lore.kernel.org . It is one patch with subject "[PATCH] staging: r8188eu: core: remove goto statement"

https://lore.kernel.org/all/?q=Saurav+Girepunje

Regards,
Saurav