lkml.org 
[lkml]   [2023]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] ath9k: unify error handling code in ath9k_hif_usb_resume
From

On 9/4/23 18:06, Toke Høiland-Jørgensen wrote:
> Dongliang Mu <dzm91@hust.edu.cn> writes:
>
>> In ath9k_hif_usb_resume, the error handling code calls
>> ath9k_hif_usb_dealloc_urbs twice in different paths.
>>
>> To unify the error handling code, we replace one error handling path
>> with a goto statement.
>>
>> Note that this patch does not incur any functionability change.
>>
>> Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
> Hmm, if you're cleaning up that function, how about changing that else
> to an early error return? I.e. change the if at the top to:
>
> if (!(hif_dev->flags & HIF_USB_READY)) {
> ret = -EIO;
> goto fail_resume;
> }
>
> and drop one level of indentation from what is currently in the top
> branch of the if statement.

Yeah, this is more elegant. I've sent a patch v2.

Dongliang Mu

>
> Also, while you're at it, please reorder the variable declarations at
> the top of the function to be reverse x-mas tree order (moving the 'int
> ret' declaration to the bottom).
>
> -Toke

\
 
 \ /
  Last update: 2023-09-05 18:43    [W:0.052 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site