[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211117133724.GK2435591@roeck-us.net>
Date: Wed, 17 Nov 2021 05:37:24 -0800
From: Guenter Roeck <linux@...ck-us.net>
To: Sam Protsenko <semen.protsenko@...aro.org>
Cc: Wim Van Sebroeck <wim@...ux-watchdog.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>,
linux-watchdog@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org
Subject: Re: [PATCH v3 11/12] watchdog: s3c2410: Remove superfluous err label
On Sun, Nov 07, 2021 at 10:29:42PM +0200, Sam Protsenko wrote:
> 'err' label in probe function is not really need, it just returns.
> Remove it and replace all 'goto' statements with actual returns in
> place.
>
> No functional change here, just a cleanup patch.
>
> Signed-off-by: Sam Protsenko <semen.protsenko@...aro.org>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>
Reviewed-by: Guenter Roeck <linux@...ck-us.net>
> ---
> Changes in v3:
> - Added R-b tag by Krzysztof Kozlowski
>
> Changes in v2:
> - (none): it's a new patch
>
> drivers/watchdog/s3c2410_wdt.c | 13 ++++---------
> 1 file changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
> index f31bc765a8a5..96aa5d9c6ed4 100644
> --- a/drivers/watchdog/s3c2410_wdt.c
> +++ b/drivers/watchdog/s3c2410_wdt.c
> @@ -627,22 +627,18 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
> wdt_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> if (wdt_irq == NULL) {
> dev_err(dev, "no irq resource specified\n");
> - ret = -ENOENT;
> - goto err;
> + return -ENOENT;
> }
>
> /* get the memory region for the watchdog timer */
> wdt->reg_base = devm_platform_ioremap_resource(pdev, 0);
> - if (IS_ERR(wdt->reg_base)) {
> - ret = PTR_ERR(wdt->reg_base);
> - goto err;
> - }
> + if (IS_ERR(wdt->reg_base))
> + return PTR_ERR(wdt->reg_base);
>
> wdt->bus_clk = devm_clk_get(dev, "watchdog");
> if (IS_ERR(wdt->bus_clk)) {
> dev_err(dev, "failed to find bus clock\n");
> - ret = PTR_ERR(wdt->bus_clk);
> - goto err;
> + return PTR_ERR(wdt->bus_clk);
> }
>
> ret = clk_prepare_enable(wdt->bus_clk);
> @@ -757,7 +753,6 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
> err_bus_clk:
> clk_disable_unprepare(wdt->bus_clk);
>
> - err:
> return ret;
> }
>
> --
> 2.30.2
>
Powered by blists - more mailing lists