Re: [PATCH v4 07/10] powercap: dtpm_cpu: Use scope-based cleanup helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/09/2025 12:37, Zihuan Zhang wrote:
>>   * Lastly, given that the benefit of cleanup helpers is removal of
>>   * "goto", and that the "goto" statement can jump between scopes, the
>>   * expectation is that usage of "goto" and cleanup helpers is never
>>   * mixed in the same function. I.e. for a given routine, convert all
>>   * resources that need a "goto" cleanup to scope-based cleanup, or
>>   * convert none of them.
> 
> 
> Should I replace all the memory allocation cleanups here with `__free`?
> That would allow us to drop all the `goto`s, but since this function has
> quite a few of them, I’m concerned it might introduce new issues. What’s
> your recommendation?

If you keep asking this, I have doubts you really know how to use
cleanup.h. Don't blindly convert code to cleanup.h. It's very odd syntax
and it is not even welcomed everywhere.

Best regards,
Krzysztof




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux