From: Jonathan Cameron <jic23@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Markus Elfring <Markus.Elfring@web.de>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-gpio@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] pinctrl: pistachio: Use scope-based resource management in pistachio_gpio_register()
Date: Mon, 17 Jun 2024 21:19:31 +0100 [thread overview]
Message-ID: <20240617211931.70bd2d31@jic23-huawei> (raw)
In-Reply-To: <CACRpkdanLmWrDD6AdzJJx3fJsQWTE64vh+MjOtDTkpzwqqPkuQ@mail.gmail.com>
On Mon, 17 Jun 2024 10:32:03 +0200
Linus Walleij <linus.walleij@linaro.org> wrote:
> On Wed, Jun 5, 2024 at 6:02 PM Markus Elfring <Markus.Elfring@web.de> wrote:
>
> > From: Markus Elfring <elfring@users.sourceforge.net>
> > Date: Wed, 5 Jun 2024 17:46:52 +0200
> >
> > Scope-based resource management became supported also for another
> > programming interface by contributions of Jonathan Cameron on 2024-02-17.
> > See also the commit 59ed5e2d505bf5f9b4af64d0021cd0c96aec1f7c ("device
> > property: Add cleanup.h based fwnode_handle_put() scope based cleanup.").
> >
> > * Thus use the attribute “__free(fwnode_handle)”.
> >
> > * Reduce the scope for the local variable “child”.
> >
> > * Omit explicit fwnode_handle_put() calls accordingly.
> >
> > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
>
> Looks reasonable but I'd like Jonathan's and Andy's review tags on this.
>
> Yours,
> Linus Walleij
I took a look and it makes me a little nervous. Markus' patch isn't
changing behaviour (I think) but i is mixing scoped handling with non
scoped handling which I'm not keen on. I'm also struggling to understand
how the code was right prior to this patch. In particular what cleans
up the fwnode_handle after the point where Markus has used no_free_ptr()?
Whilst it's assigned to the gpio_chip that chip hasn't been added when
girq->parents is allocated so even if there is some magic path to clearing
it up I'm not immediately seeing how that can be working here.
So this feels like there are more gremlins hiding here and Markus' patch
may not help flush them out.
Jonathan
prev parent reply other threads:[~2024-06-17 20:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-05 16:02 [PATCH] pinctrl: pistachio: Use scope-based resource management in pistachio_gpio_register() Markus Elfring
2024-06-17 8:32 ` Linus Walleij
2024-06-17 20:19 ` Jonathan Cameron [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=20240617211931.70bd2d31@jic23-huawei \
--to=jic23@kernel.org \
--cc=Markus.Elfring@web.de \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.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