lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZuSRnoaUu-YCOX5L@smile.fi.intel.com>
Date: Fri, 13 Sep 2024 22:25:18 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
	Daniel Scally <djrscally@...il.com>,
	Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
	Sakari Ailus <sakari.ailus@...ux.intel.com>,
	"Rafael J. Wysocki" <rafael@...nel.org>
Subject: Re: [PATCH v1 1/1] software node: Simplify swnode_register() a bit

On Fri, Sep 13, 2024 at 03:34:58PM +0200, Greg Kroah-Hartman wrote:
> On Fri, Sep 13, 2024 at 02:05:23PM +0300, Andy Shevchenko wrote:

...

> > +	struct kobject *kobj_parent = parent ? &parent->kobj : NULL;
> 
> I despise ?: use just so much, EXCEPT for when it's used in something
> like this:

> >  		ret = kobject_init_and_add(&swnode->kobj, &software_node_type,
> > -					   parent ? &parent->kobj : NULL,
> > -					   "%s", node->name);
> > +					   kobj_parent, "%s", node->name);
> 
> Which really is the only valid way I'd put up with it :)

I see your point!

> So can you rewrite the change above to be just:
> 
> 	struct kobject *kobj_parent = NULL;
> 
> 	...
> 
> 	if (parent)
> 		kobj_parent = &parent->kobj;
> 
> Which is much simpler to read, right?

Yeah, but the point of the patch seems to be diminished. Let's just not
continue with it for now. Maybe later it will make more sense.

Thank you for the review!

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ