[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdWwegdks3eEviEsBJE3AvUVKbZqHduYdhuwz=8xTMDs5g@mail.gmail.com>
Date: Fri, 1 Mar 2024 14:05:10 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Markus Elfring <Markus.Elfring@....de>
Cc: linux-renesas-soc@...r.kernel.org, linux-media@...r.kernel.org,
kernel-janitors@...r.kernel.org, Mauro Carvalho Chehab <mchehab@...nel.org>,
Niklas Söderlund <niklas.soderlund@...natech.se>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] media: rcar-csi2: Use common error handling code in rcsi2_parse_dt()
Hi Markus,
On Fri, Mar 1, 2024 at 1:10 PM Markus Elfring <Markus.Elfring@....de> wrote:
> From: Markus Elfring <elfring@...rs.sourceforge.net>
> Date: Fri, 1 Mar 2024 13:02:18 +0100
>
> Add a label so that a bit of exception handling can be better reused
> in an if branch of this function implementation.
>
> Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
Thanks for your patch!
> --- a/drivers/media/platform/renesas/rcar-csi2.c
> +++ b/drivers/media/platform/renesas/rcar-csi2.c
> @@ -1388,12 +1388,13 @@ static int rcsi2_parse_dt(struct rcar_csi2 *priv)
> ret = v4l2_fwnode_endpoint_parse(ep, &v4l2_ep);
> if (ret) {
> dev_err(priv->dev, "Could not parse v4l2 endpoint\n");
> - fwnode_handle_put(ep);
> - return -EINVAL;
> + ret = -EINVAL;
> + goto put_fwnode_ep;
> }
>
> ret = rcsi2_parse_v4l2(priv, &v4l2_ep);
> if (ret) {
> +put_fwnode_ep:
> fwnode_handle_put(ep);
> return ret;
> }
Please do not use goto to jump to random positions buried deep inside
a function,as this makes the code harder to read.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68korg
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists