lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <03b93d98-5722-4592-9346-30a3b4f95d1f@linaro.org>
Date: Wed, 14 Aug 2024 20:01:09 +0200
From: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To: Jonathan Cameron <Jonathan.Cameron@...wei.com>
Cc: Krzysztof Kozlowski <krzk@...nel.org>,
 Nicolas Ferre <nicolas.ferre@...rochip.com>,
 Alexandre Belloni <alexandre.belloni@...tlin.com>,
 Claudiu Beznea <claudiu.beznea@...on.dev>, Lukasz Luba
 <lukasz.luba@....com>, Alim Akhtar <alim.akhtar@...sung.com>,
 Maxime Coquelin <mcoquelin.stm32@...il.com>,
 Alexandre Torgue <alexandre.torgue@...s.st.com>,
 Thierry Reding <thierry.reding@...il.com>,
 Jonathan Hunter <jonathanh@...dia.com>,
 Santosh Shilimkar <ssantosh@...nel.org>, linux-kernel@...r.kernel.org,
 linux-arm-kernel@...ts.infradead.org, linux-pm@...r.kernel.org,
 linux-samsung-soc@...r.kernel.org, linux-stm32@...md-mailman.stormreply.com,
 linux-tegra@...r.kernel.org
Subject: Re: [PATCH 9/9] memory: ti-aemif: simplify with scoped for each OF
 child loop

On 14/08/2024 18:55, Jonathan Cameron wrote:
> On Mon, 12 Aug 2024 15:34:03 +0200
> Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org> wrote:
> 
>> Use scoped for_each_available_child_of_node_scoped() when iterating over
>> device nodes to make code a bit simpler.
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
> Nothing wrong with this patch, but I think you can add a precusor
> that will make this neater.
> 
> Jonathan
> 
>> ---
>>  drivers/memory/ti-aemif.c | 13 ++++---------
>>  1 file changed, 4 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/memory/ti-aemif.c b/drivers/memory/ti-aemif.c
>> index e192db9e0e4b..cd2945d4ec18 100644
>> --- a/drivers/memory/ti-aemif.c
>> +++ b/drivers/memory/ti-aemif.c
>> @@ -330,7 +330,6 @@ static int aemif_probe(struct platform_device *pdev)
>>  	int ret = -ENODEV;
>>  	struct device *dev = &pdev->dev;
>>  	struct device_node *np = dev->of_node;
>> -	struct device_node *child_np;
>>  	struct aemif_device *aemif;
>>  	struct aemif_platform_data *pdata;
>>  	struct of_dev_auxdata *dev_lookup;
>> @@ -374,12 +373,10 @@ static int aemif_probe(struct platform_device *pdev)
>>  		 * functions iterate over these nodes and update the cs data
>>  		 * array.
>>  		 */
>> -		for_each_available_child_of_node(np, child_np) {
>> +		for_each_available_child_of_node_scoped(np, child_np) {
>>  			ret = of_aemif_parse_abus_config(pdev, child_np);
>> -			if (ret < 0) {
>> -				of_node_put(child_np);
>> +			if (ret < 0)
>>  				goto error;
> I'd precede this patch with use of
> devm_clk_get_enabled()
> 
> That would avoid what looks like potential mixed devm and not issues
> and let you return here.

Yep, that would be useful.

Best regards,
Krzysztof


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ