mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Daniel Scally <djrscally@gmail.com>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>
Subject: Re: [PATCH v1 1/1] software node: Simplify swnode_register() a bit
Date: Fri, 13 Sep 2024 22:25:18 +0300	[thread overview]
Message-ID: <ZuSRnoaUu-YCOX5L@smile.fi.intel.com> (raw)
In-Reply-To: <2024091300-afford-tamper-1831@gregkh>

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



      reply	other threads:[~2024-09-13 19:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-13 11:05 Andy Shevchenko
2024-09-13 11:16 ` Sakari Ailus
2024-09-13 13:34 ` Greg Kroah-Hartman
2024-09-13 19:25   ` Andy Shevchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZuSRnoaUu-YCOX5L@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=djrscally@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®