mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Xu Yang <xu.yang_2@nxp.com>,
	linux-acpi@vger.kernel.org, driver-core@lists.linux.dev,
	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>,
	Danilo Krummrich <dakr@kernel.org>
Subject: Re: [PATCH v4 2/3] device property: Refactor to use RAII approach
Date: Fri, 12 Jun 2026 00:12:18 +0300	[thread overview]
Message-ID: <aisksqCUWUBGV2lg@ashevche-desk.local> (raw)
In-Reply-To: <CAJZ5v0jPkVr9=6HZ2gbCTtcQjmrH+3yZaiXi5jfkfD8aLzOPug@mail.gmail.com>

On Thu, Jun 11, 2026 at 10:46:31PM +0200, Rafael J. Wysocki wrote:
> On Thu, Jun 11, 2026 at 10:35 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > In a couple of functions code can be made cleaner with help of
> > __free() macro. Refactor these to use RAII approach.

...

> >  fwnode_graph_get_next_endpoint(const struct fwnode_handle *fwnode,
> >                                struct fwnode_handle *prev)
> >  {
> > -       struct fwnode_handle *ep, *port_parent = NULL;
> >         const struct fwnode_handle *parent;
> > +       struct fwnode_handle *port_parent __free(fwnode_handle) = NULL;
> 
> The thing on the right-hand side of the assignment should be a
> constructor, shouldn't it?

Nope. It's a recommendation to do a such, but in this case it's hard to achieve
(since the constructor is inside the conditional scope) and actually is not needed
as we don't mix up with other RAII calls, such a guard()().

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-06-11 21:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-11 20:31 [PATCH v4 0/3] device property: fix child iteration issues with secondary fwnodes Andy Shevchenko
2026-06-11 20:31 ` [PATCH v4 1/3] device property: fix infinite loop in fwnode_for_each_child_node() Andy Shevchenko
2026-06-12  6:47   ` Xu Yang
2026-06-11 20:31 ` [PATCH v4 2/3] device property: Refactor to use RAII approach Andy Shevchenko
2026-06-11 20:46   ` Rafael J. Wysocki
2026-06-11 21:12     ` Andy Shevchenko [this message]
2026-06-11 20:31 ` [PATCH v4 3/3] device property: add test cases for fwnode_for_each_child_node() Andy Shevchenko
2026-07-18 14:18   ` Danilo Krummrich
2026-07-19  8:37     ` Andy Shevchenko
2026-07-20 10:46       ` Xu Yang
2026-07-06  3:16 ` [PATCH v4 0/3] device property: fix child iteration issues with secondary fwnodes Xu Yang

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=aisksqCUWUBGV2lg@ashevche-desk.local \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=dakr@kernel.org \
    --cc=djrscally@gmail.com \
    --cc=driver-core@lists.linux.dev \
    --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 \
    --cc=xu.yang_2@nxp.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®