[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAPDyKFrfwJeupJ50smx8Qu5Zpk74ATcQXGVqu5sAsFY2ou3VFw@mail.gmail.com>
Date: Tue, 23 Oct 2018 15:01:43 +0200
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Chunyan Zhang <zhang.chunyan@...aro.org>
Cc: Adrian Hunter <adrian.hunter@...el.com>,
"linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linus Walleij <linus.walleij@...aro.org>,
Chunyan Zhang <zhang.lyra@...il.com>
Subject: Re: [PATCH] mmc: sdhci: use goto rather than return directly
On 16 October 2018 at 10:19, Chunyan Zhang <zhang.chunyan@...aro.org> wrote:
> The driver should clean resources requested in the function before
> unnormal return.
>
> CC: Linus Walleij <linus.walleij@...aro.org>
> Signed-off-by: Chunyan Zhang <zhang.chunyan@...aro.org>
> Fixes: bd9b902798ab ("mmc: sdhci: Implement an SDHCI-specific bounce buffer")
> ---
> drivers/mmc/host/sdhci.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 1b3fbd9..f6b57e1 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -3991,7 +3991,7 @@ int sdhci_setup_host(struct sdhci_host *host)
> /* This may alter mmc->*_blk_* parameters */
> ret = sdhci_allocate_bounce_buffer(host);
> if (ret)
> - return ret;
> + goto unreg;
Instead of making the error path a bit more complicated, I suggest to
convert sdhci_allocate_bounce_buffer() from returning an int to a
void. Simply because it always returns 0 and thus we can remove this
error path altogether.
> }
>
> return 0;
> --
> 2.7.4
>
Kind regards
Uffe
Powered by blists - more mailing lists