On Fri, Aug 23, 2024 at 04:40:36PM +0800, Chen-Yu Tsai wrote: > On Thu, Aug 22, 2024 at 10:02 PM Andy Shevchenko > <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote: > > On Thu, Aug 22, 2024 at 05:19:59PM +0800, Chen-Yu Tsai wrote: ... > > > + ret = of_changeset_apply(ocs); > > > + if (!ret) { > > > > Why not positive conditional? > > No real reason. I suppose having the error condition come first is more > common. Yes, when you have something like if (err) { ... return err; } else { ... } But you don't. That's why I commented on this. > Not sure if it makes any difference in this case though? ! is hard to read by a human being, easy to make a mistake in the brain of reader and with inverted logic the code reading becomes harder. So, it's pure about cognitive function. > > > + /* > > > + * ocs is intentionally kept around as it needs to > > > + * exist as long as the change is applied. > > > + */ > > > + void *ptr __always_unused = no_free_ptr(ocs); > > > + } else { > > > + /* ocs needs to be explicitly cleaned up before being freed. */ > > > + of_changeset_destroy(ocs); > > > + } -- With Best Regards, Andy Shevchenko