public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Dan Carpenter <dan.carpenter@linaro.org>,
	Luca Ceresoli <luca.ceresoli@bootlin.com>,
	linux-staging@lists.linux.dev, linux-tegra@vger.kernel.org,
	linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Sowjanya Komatineni <skomatineni@nvidia.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: staging: media: tegra-video: Use common error handling code in tegra_vi_graph_parse_one()
Date: Sat, 2 Mar 2024 11:40:26 +0100	[thread overview]
Message-ID: <f451ffba-db26-4a3b-a4b3-186c31f2ad64@web.de> (raw)
In-Reply-To: <9f1b617f-06cb-4b22-a050-325424720c57@moroto.mountain>

>>> Add a jump target so that a bit of exception handling can be better reused
>>> at the end of this function implementation.
>> Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
>
> These patches make the code worse.  If we're in the middle of a loop,
> then we should clean up the partial loop before doing the goto.
> Otherwise it creates a mess when we add a new allocation function after
> the end of the loop.

How does such a feedback fit to another known information source?

Section “7) Centralized exiting of functions”
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v6.8-rc6#n526


> Someone is going to add a _scoped() loop which uses cleanup.h magic to
> call _put automatically.  This is a good option.

I became also curious how scope-based resource management will influence
Linux coding styles further.
Will various collateral evolution become more interesting?

Regards,
Markus

  reply	other threads:[~2024-03-02 10:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-29 18:55 [PATCH] staging: media: tegra-video: Use common error handling code in tegra_vi_graph_parse_one() Markus Elfring
2024-03-01 17:39 ` Luca Ceresoli
2024-03-02  9:30   ` Dan Carpenter
2024-03-02 10:40     ` Markus Elfring [this message]
2024-03-05 15:24       ` Luca Ceresoli
2024-03-05 16:21         ` Dan Carpenter

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=f451ffba-db26-4a3b-a4b3-186c31f2ad64@web.de \
    --to=markus.elfring@web.de \
    --cc=dan.carpenter@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jonathanh@nvidia.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=linux-tegra@vger.kernel.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=mchehab@kernel.org \
    --cc=skomatineni@nvidia.com \
    --cc=thierry.reding@gmail.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