From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Julia Lawall <julia.lawall@inria.fr>
Cc: "Markus Elfring" <Markus.Elfring@web.de>,
linux-input@vger.kernel.org, kernel-janitors@vger.kernel.org,
"Jeff LaBundy" <jeff@labundy.com>,
"Rob Herring" <robh@kernel.org>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
LKML <linux-kernel@vger.kernel.org>,
"Jonathan Cameron" <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH v2] Input: iqs626a - Use scope-based resource management in iqs626_parse_events()
Date: Mon, 4 Mar 2024 09:16:23 -0800 [thread overview]
Message-ID: <ZeYB51RRw6Lg0XSh@google.com> (raw)
In-Reply-To: <b91fe21-fe2-eac8-d1ee-ea8922a08861@inria.fr>
On Mon, Mar 04, 2024 at 11:55:23AM +0100, Julia Lawall wrote:
>
>
> On Mon, 4 Mar 2024, Markus Elfring wrote:
>
> > From: Markus Elfring <elfring@users.sourceforge.net>
> > Date: Mon, 4 Mar 2024 11:40:04 +0100
> >
> > Scope-based resource management became supported also for this software
> > area by contributions of Jonathan Cameron on 2024-02-17.
> >
> > device property: Add cleanup.h based fwnode_handle_put() scope based cleanup.
> > https://lore.kernel.org/r/20240217164249.921878-3-jic23@kernel.org
> >
> >
> > * Thus use the attribute “__free(fwnode_handle)”.
> >
> > * Reduce the scope for the local variable “ev_node” into a for loop.
> >
> > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> > ---
> >
> > v2:
> > An other cleanup technique was applied as requested by Dmitry Torokhov
> > and Jeff LaBundy.
> >
> >
> > drivers/input/misc/iqs626a.c | 8 ++------
> > 1 file changed, 2 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/input/misc/iqs626a.c b/drivers/input/misc/iqs626a.c
> > index 0dab54d3a060..86fcb5134f45 100644
> > --- a/drivers/input/misc/iqs626a.c
> > +++ b/drivers/input/misc/iqs626a.c
> > @@ -462,7 +462,6 @@ iqs626_parse_events(struct iqs626_private *iqs626,
> > {
> > struct iqs626_sys_reg *sys_reg = &iqs626->sys_reg;
> > struct i2c_client *client = iqs626->client;
> > - struct fwnode_handle *ev_node;
> > const char *ev_name;
> > u8 *thresh, *hyst;
> > unsigned int val;
> > @@ -501,6 +500,8 @@ iqs626_parse_events(struct iqs626_private *iqs626,
> > if (!iqs626_channels[ch_id].events[i])
> > continue;
> >
> > + struct fwnode_handle *ev_node __free(fwnode_handle);
>
> Doesn't this need to be initialized?
It would be better if we had a helper here, iqs626_get_ev_node() or
something.
Thanks.
--
Dmitry
prev parent reply other threads:[~2024-03-04 17:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-02 11:42 [PATCH] Input: iqs626a - Use common error handling code in iqs626_parse_events() Markus Elfring
2024-03-04 3:12 ` Jeff LaBundy
2024-03-04 4:29 ` Dmitry Torokhov
2024-03-04 8:18 ` Dan Carpenter
2024-03-04 12:31 ` Markus Elfring
2024-03-04 10:52 ` [PATCH v2] Input: iqs626a - Use scope-based resource management " Markus Elfring
2024-03-04 10:55 ` Julia Lawall
2024-03-04 11:32 ` Dan Carpenter
2024-03-04 13:30 ` Markus Elfring
2024-03-04 12:10 ` [PATCH v2] " Markus Elfring
2024-03-04 17:16 ` Dmitry Torokhov [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=ZeYB51RRw6Lg0XSh@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=Markus.Elfring@web.de \
--cc=jeff@labundy.com \
--cc=julia.lawall@inria.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=u.kleine-koenig@pengutronix.de \
/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.