All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Sa, Nuno" <Nuno.Sa@analog.com>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"linux-kernel@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>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>
Subject: Re: [PATCH v3 1/1] device property: Allow error pointer to be passed to fwnode APIs
Date: Tue, 8 Mar 2022 12:09:53 +0200	[thread overview]
Message-ID: <YicrcRUXVKzETq+l@smile.fi.intel.com> (raw)
In-Reply-To: <PH0PR03MB67867223806C29FF1DF90E6499099@PH0PR03MB6786.namprd03.prod.outlook.com>

On Tue, Mar 08, 2022 at 09:25:07AM +0000, Sa, Nuno wrote:
> > -----Original Message-----
> > From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Sent: Monday, March 7, 2022 9:30 PM

...

> > v3: dropped test of secondary fwnode (Nuno), added tag (Nuno),
> > amended commit message
> > v2: adjusted the entire fwnode API (Sakari)
> > 
> > Nuno, can you re-test this with the ltc2983 series to be sure it is still
> > okay?
> 
> Still works!

Thanks for confirming!

...

> > @@ -988,14 +998,14 @@ fwnode_graph_get_next_endpoint(const
> > struct fwnode_handle *fwnode,
> >  		parent = fwnode_graph_get_port_parent(prev);
> >  	else
> >  		parent = fwnode;
> > +	if (IS_ERR_OR_NULL(parent))
> > +		return NULL;

(1)

> >  	ep = fwnode_call_ptr_op(parent, graph_get_next_endpoint,
> > prev);
> > +	if (ep)
> > +		return ep;
> 
> I might be missing something but before the check being done was
> 'if (IS_ERR_OR_NULL(ep)'. Is there anyway for ep to be an error
> pointer? Looking at OF, It seems that only NULL or a valid pointer
> is being returned. Did not looked at others implementations of
> though...

Yes, the IS_ERR() part is redundant there. I was quite confused with
that code while working on this change. So, now it looks much clearer
what's going on and what kind of values are being expected. This also
justifies the choice of returned value in (1).

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2022-03-08 10:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-07 20:29 [PATCH v3 1/1] device property: Allow error pointer to be passed to fwnode APIs Andy Shevchenko
2022-03-08  9:25 ` Sa, Nuno
2022-03-08 10:09   ` Andy Shevchenko [this message]
2022-03-08 10:32     ` Sa, Nuno
2022-03-08 11:15 ` Sakari Ailus
2022-03-08 12:22   ` Andy Shevchenko

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=YicrcRUXVKzETq+l@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=Nuno.Sa@analog.com \
    --cc=djrscally@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.