Re: [v2 1/2] soc: fsl: dpio: Use scope-based resource management in dpaa2_io_store_create()

Markus Elfring <[email protected]>
Newsgroups gmane.linux.ports.ppc.embedded
Message-ID <3588f06e-7d11-4e94-b141-008e676bb28b__41626.2088155904$1785221788$gmane$org@web.de>
>> https://elixir.bootlin.com/linux/v7.2-rc4/source/include/linux/cleanup.h#L142-L146
> 
> The context for the recommendation linked by you is (also from
> cleanup.h):
> 
> 	 * "When multiple variables in the same scope have cleanup attributes,
> 	 * at exit from the scope their associated cleanup functions are run in
> 	 * reverse order of definition (last defined, first cleanup)."
> 	 *
> 	 * When the unwind order matters it requires that variables be defined
> 	 * mid-function scope rather than at the top of the file.  Take the
> 	 * following example and notice the bug highlighted by "!!"::
> 
> Which is not the case of these simple functions which only need a kfree.
How will development concerns evolve further also according to previous clarification attempts?

Clarifying confusion of our variable placement rules caused by cleanup.h
https://lore.kernel.org/ksummit/CAHk-=whPZoi03ZwphxiW6cuWPtC3nyKYS8_BThgztCdgPWP1WA@mail.gmail.com/
https://lkml.org/lkml/2025/11/18/1766

Regards,
Markus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.