From: Dongliang Mu <dzm91@hust.edu.cn>
To: "Toke Høiland-Jørgensen" <toke@toke.dk>, "Kalle Valo" <kvalo@kernel.org>
Cc: hust-os-kernel-patches@googlegroups.com,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ath9k: unify error handling code in ath9k_hif_usb_resume
Date: Tue, 5 Sep 2023 09:36:58 +0800 [thread overview]
Message-ID: <3cec1ac9-5cbf-648c-69ca-12e757bb7617@hust.edu.cn> (raw)
In-Reply-To: <87v8cqs165.fsf@toke.dk>
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
prev parent reply other threads:[~2023-09-05 16:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-03 12:32 Dongliang Mu
2023-09-04 10:06 ` Toke Høiland-Jørgensen
2023-09-05 1:36 ` Dongliang Mu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3cec1ac9-5cbf-648c-69ca-12e757bb7617@hust.edu.cn \
--to=dzm91@hust.edu.cn \
--cc=hust-os-kernel-patches@googlegroups.com \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=toke@toke.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®