Re: [PATCH v2 01/14] device property: Add cleanup.h based fwnode_handle_put() scope based cleanup.

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

 



On Mon, Feb 12, 2024 at 08:49:23AM +0000, Sakari Ailus wrote:
> On Sun, Feb 11, 2024 at 07:25:27PM +0000, Jonathan Cameron wrote:

...

> > +DEFINE_FREE(fwnode_handle, struct fwnode_handle *,
> > +	    if (!IS_ERR_OR_NULL(_T)) fwnode_handle_put(_T))
> 
> fwnode_handle_put() can be safely called on NULL or error pointer fwnode

Yes.

> so you can remove the check.

No. (Technically "yes", but better "no".)

This has been discussed a lot, including the LWN wrap-up about the cleanup.h.

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