linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Michael Walle <michael@walle.cc>
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>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	"Len Brown" <lenb@kernel.org>, "Nuno Sá" <nuno.sa@analog.com>
Subject: Re: [PATCH v5 1/4] device property: Allow error pointer to be passed to fwnode APIs
Date: Thu, 7 Apr 2022 13:19:44 +0300	[thread overview]
Message-ID: <Yk66wHWlMg3QLy6u@smile.fi.intel.com> (raw)
In-Reply-To: <df3a78036864716fbeecf3cd94dbcbbe@walle.cc>

On Wed, Apr 06, 2022 at 08:05:23PM +0200, Michael Walle wrote:

...

> > +	if (IS_ERR_OR_NULL(fwnode))
> > +		return -ENOENT;
> > +
> >  	ret = fwnode_call_int_op(fwnode, get_reference_args, prop, nargs_prop,
> >  				 nargs, index, args);
> > +	if (ret == 0)
> > +		return ret;
> > 
> > -	if (ret < 0 && !IS_ERR_OR_NULL(fwnode) &&
> > -	    !IS_ERR_OR_NULL(fwnode->secondary))
> > -		ret = fwnode_call_int_op(fwnode->secondary, get_reference_args,
> > -					 prop, nargs_prop, nargs, index, args);
> > +	if (IS_ERR_OR_NULL(fwnode->secondary))
> > +		return -ENOENT;
> 
> Doesn't this mean you overwrite any return code != 0 with -ENOENT?
> Is this intended?

Indeed, it would shadow the error code.
So, it should go with

	if (IS_ERR_OR_NULL(fwnode->secondary))
		return ret;

then.

> In any case:
> Tested-by: Michael Walle <michael@walle.cc>

Thanks!

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2022-04-07 10:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-06 13:05 [PATCH v5 1/4] device property: Allow error pointer to be passed to fwnode APIs Andy Shevchenko
2022-04-06 13:05 ` [PATCH v5 2/4] device property: Introduce fwnode_for_each_parent_node() Andy Shevchenko
2022-04-06 13:26   ` Sakari Ailus
2022-04-06 13:05 ` [PATCH v5 3/4] device property: Drop 'test' prefix in parameters of fwnode_is_ancestor_of() Andy Shevchenko
2022-04-06 13:05 ` [PATCH v5 4/4] device property: Constify fwnode APIs that uses fwnode_get_next_parent() Andy Shevchenko
2022-04-06 17:51   ` kernel test robot
2022-04-06 19:24   ` kernel test robot
2022-04-07  6:41   ` kernel test robot
2022-04-06 18:05 ` [PATCH v5 1/4] device property: Allow error pointer to be passed to fwnode APIs Michael Walle
2022-04-07 10:19   ` Andy Shevchenko [this message]
2022-04-08 12:44     ` Andy Shevchenko
2022-04-08 13:27       ` Sakari Ailus
2022-04-08 14:53         ` 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=Yk66wHWlMg3QLy6u@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=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael@walle.cc \
    --cc=nuno.sa@analog.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).