From: Arend Van Spriel <arend.vanspriel@broadcom.com>
To: Marcin Rokicki <marcin.rokicki@tieto.com>, ath10k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] ath10k: Remove return statement from a void function
Date: Tue, 21 Feb 2017 10:44:26 +0100 [thread overview]
Message-ID: <145513d5-e8d7-c7e4-810b-fc278cea3ace@broadcom.com> (raw)
In-Reply-To: <1487667873-3493-1-git-send-email-marcin.rokicki@tieto.com>
On 21-2-2017 10:04, Marcin Rokicki wrote:
> The empty 'return;' statement in a void function should be
> used to return from somewhere else then the end.
>
> Signed-off-by: Marcin Rokicki <marcin.rokicki@tieto.com>
> ---
> drivers/net/wireless/ath/ath10k/core.c | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
> index 59729aa..d65850e 100644
> --- a/drivers/net/wireless/ath/ath10k/core.c
> +++ b/drivers/net/wireless/ath/ath10k/core.c
> @@ -2268,7 +2268,7 @@ static void ath10k_core_register_work(struct work_struct *work)
> status = ath10k_core_probe_fw(ar);
> if (status) {
> ath10k_err(ar, "could not probe fw (%d)\n", status);
> - goto err;
> + return;
The subject seems misleading as you add a return here. Also removing the
goto will break the desired behavior as expressed in the TODO below.
> }
>
> status = ath10k_mac_register(ar);
> @@ -2307,11 +2307,10 @@ static void ath10k_core_register_work(struct work_struct *work)
> ath10k_mac_unregister(ar);
> err_release_fw:
> ath10k_core_free_firmware_files(ar);
> -err:
> - /* TODO: It's probably a good idea to release device from the driver
> - * but calling device_release_driver() here will cause a deadlock.
> - */
> - return;
So to me removing this return statement and no more is sufficient for
this patch. Just leave the label and TODO comment in place or fix it
properly by scheduling a "release driver" work here or whatever is
needed to prevent the deadlock.
Regards,
Arend
> +
> +/* TODO: It's probably a good idea to release device from the driver
> + * but calling device_release_driver() here will cause a deadlock.
> + */
> }
>
> int ath10k_core_register(struct ath10k *ar, u32 chip_id)
>
prev parent reply other threads:[~2017-02-21 9:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-21 9:04 [PATCH] ath10k: Remove return statement from a void function Marcin Rokicki
2017-02-21 9:44 ` Arend Van Spriel [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=145513d5-e8d7-c7e4-810b-fc278cea3ace@broadcom.com \
--to=arend.vanspriel@broadcom.com \
--cc=ath10k@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=marcin.rokicki@tieto.com \
/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