Re: [PATCH 00/13] device property / IIO: Use cleanup.h magic for fwnode_handle_put() handling.

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

 



On Sun, Jan 14, 2024 at 05:19:56PM +0000, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
> 
> Chances since RFC.
> - Add if (!IS_ERR_OR_NULL(_T)) check as suggested by Andy Shevchenko.
>   This may allow the compiler to optimize cases where it can tell that
>   this check will fail rather than calling into fwnode_handle_put().

FWIW, this nuance is mentioned in [1] as:

  "Within the macro, this declaration is creating a new function called
  __free_kfree() that makes a call to kfree() if the passed-in pointer is not
  NULL. Nobody will ever call that function directly, but the declaration makes
  it possible to write code like: ..."

Not so explicit, but still...

[1]: https://lwn.net/Articles/934679/

-- 
With Best Regards,
Andy Shevchenko






[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