public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Daniel Scally <djrscally@gmail.com>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Daniel Kaehn <kaehndan@gmail.com>
Subject: Re: [PATCH v1 1/1] device property: Clarify description on returned value in some functions
Date: Fri, 17 Feb 2023 13:44:25 +0200	[thread overview]
Message-ID: <Y+9omTMIzAxWM2by@kekkonen.localdomain> (raw)
In-Reply-To: <Y+9k9wkRgE1JOsr0@smile.fi.intel.com>

On Fri, Feb 17, 2023 at 01:28:55PM +0200, Andy Shevchenko wrote:
> On Fri, Feb 17, 2023 at 01:18:31PM +0200, Sakari Ailus wrote:
> > On Fri, Feb 17, 2023 at 01:01:39PM +0200, Andy Shevchenko wrote:
> > > On Fri, Feb 17, 2023 at 12:27:53PM +0200, Sakari Ailus wrote:
> > > > On Thu, Feb 16, 2023 at 10:57:08PM +0200, Andy Shevchenko wrote:
> 
> ...
> 
> > > > >   * fwnode_get_next_child_node - Return the next child node handle for a node
> > > > >   * @fwnode: Firmware node to find the next child node for.
> > > > >   * @child: Handle to one of the node's child nodes or a %NULL handle.
> > > > > + *
> > > > > + * Caller is responsible to call fwnode_handle_put() on the returned fwnode
> > > > > + * pointer.
> > > > 
> > > > The loop itself will also put the child node, so this is only relevant
> > > > outside the loop.
> > > 
> > > Yes and this is exactly what people stumbled over. Hence this note.
> > > This call per se doesn't loop, so I didn't get how your comment can
> > > be transformed to anything here. Care to elaborate a bit more on
> > > what I have to add here or reword?
> > 
> > Ah, indeed. This is achieved by putting the previous child. Generally this
> > function is used via the loop helper macro and not called directly, hence
> > the documentation there matters the most. Those functions appear to be
> > without any documentation though.
> 
> So, what should I do?

Good question.

How about this text:

The caller is responsible for calling fwnode_handle_put() put on the
returned fwnode. Note that this function also puts a reference to @child
unconditionally.

This is actually done by the firmware specific implementation, namely on OF
and at least should be done on swnode.

A second patch to document the fwnode iterator macros would be nice.

-- 
Sakari Ailus

  reply	other threads:[~2023-02-17 11:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-16 20:57 [PATCH v1 1/1] device property: Clarify description on returned value in some functions Andy Shevchenko
2023-02-17 10:27 ` Sakari Ailus
2023-02-17 11:01   ` Andy Shevchenko
2023-02-17 11:18     ` Sakari Ailus
2023-02-17 11:28       ` Andy Shevchenko
2023-02-17 11:44         ` Sakari Ailus [this message]
2023-02-17 11:55           ` Andy Shevchenko
2023-02-17 12:04             ` Sakari Ailus

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=Y+9omTMIzAxWM2by@kekkonen.localdomain \
    --to=sakari.ailus@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=djrscally@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=kaehndan@gmail.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    /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