From: Markus Elfring <Markus.Elfring@web.de>
To: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
linux-usb@vger.kernel.org, kernel-janitors@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Xin Ji <xji@analogixsemi.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: Re: usb: typec: anx7411: Use scope-based resource management in anx7411_typec_port_probe()
Date: Thu, 6 Jun 2024 10:40:44 +0200 [thread overview]
Message-ID: <a3363ad5-26ff-45a6-841b-b090baa5a19d@web.de> (raw)
In-Reply-To: <ZmFqWxqOsd6FxD3l@kuha.fi.intel.com>
>> 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 “fwnode”.
>>
>> Fixes: fe6d8a9c8e64 ("usb: typec: anx7411: Add Analogix PD ANX7411 support")
>> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
>
> Was the fwnode leaked, or why else is this a "fix"? It's not clear
> from the commit message.
Can you notice that fwnode_handle_put() calls were forgotten
in the mentioned function implementation?
https://elixir.bootlin.com/linux/v6.10-rc2/source/drivers/usb/typec/anx7411.c#L1140
I propose another code cleanup accordingly.
Will development attention grow anyhow for information in the available
API documentation?
Example:
device_get_named_child_node()
https://elixir.bootlin.com/linux/v6.10-rc2/source/drivers/base/property.c#L839
Regards,
Markus
next prev parent reply other threads:[~2024-06-06 8:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-05 17:11 [PATCH] usb: typec: anx7411: Use scope-based resource management in anx7411_typec_port_probe() Markus Elfring
2024-06-06 7:50 ` Heikki Krogerus
2024-06-06 8:40 ` Markus Elfring [this message]
2024-06-06 9:17 ` Jonathan Cameron
2024-06-06 11:01 ` Markus Elfring
2024-06-28 7:26 ` [PATCH 2] " Markus Elfring
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=a3363ad5-26ff-45a6-841b-b090baa5a19d@web.de \
--to=markus.elfring@web.de \
--cc=Jonathan.Cameron@huawei.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=xji@analogixsemi.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