Re: staging: media: tegra-video: Use common error handling code in tegra_vi_graph_parse_one()

From: Markus Elfring
Date: Sat Mar 02 2024 - 05:41:06 EST


>>> 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@xxxxxxxxxxx>
>
> 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