[PATCH] coresight: trbe: Use scope-based resource management in arm_trbe_alloc_buffer()

Markus Elfring Markus.Elfring at web.de
Thu Sep 11 23:00:07 PDT 2025


>> Scope-based resource management became supported for some
>> programming interfaces by contributions of Peter Zijlstra on 2023-05-26.
>> See also the commit 54da6a0924311c7cf5015533991e44fb8eb12773 ("locking:
> 
> 			^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> SHA ID here just needs first 12 digits not the entire string.

See also once more:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.17-rc5#n109


>> Introduce __cleanup() based infrastructure").
>>
>> * Thus use the attribute “__free(kfree)”.
>>
>> * Reduce the scopes for the local variables “buf” and “pglist”.
> 
> What is that required ?

The needed variables should be defined in a succinct way.


>> * Omit four kfree() calls accordingly.
> 
> Right.
> 
> The commit message should be re-written with little more
> context from arm_trbe_alloc_buffer(), after describing
> the new scope-based resource management.

Which background information do you miss so far?

Regards,
Markus



More information about the linux-arm-kernel mailing list