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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <64af1408-d3c8-495b-a69c-7a0718eadfc4@linaro.org>
Date: Wed, 14 Aug 2024 19:59:54 +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 4/9] memory: stm32-fmc2-ebi: simplify with scoped for each
 OF child loop

On 14/08/2024 18:45, Jonathan Cameron wrote:
> On Mon, 12 Aug 2024 15:33:58 +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>
> Might be worth using dev_err_probe() in here. Otherwise LGTM
> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>
> 
>> ---
>>  drivers/memory/stm32-fmc2-ebi.c | 8 +-------
>>  1 file changed, 1 insertion(+), 7 deletions(-)
>>
>> diff --git a/drivers/memory/stm32-fmc2-ebi.c b/drivers/memory/stm32-fmc2-ebi.c
>> index 1c63eeacd071..7167e1da56d3 100644
>> --- a/drivers/memory/stm32-fmc2-ebi.c
>> +++ b/drivers/memory/stm32-fmc2-ebi.c
>> @@ -1573,29 +1573,25 @@ static int stm32_fmc2_ebi_setup_cs(struct stm32_fmc2_ebi *ebi,
>>  static int stm32_fmc2_ebi_parse_dt(struct stm32_fmc2_ebi *ebi)
>>  {
>>  	struct device *dev = ebi->dev;
>> -	struct device_node *child;
>>  	bool child_found = false;
>>  	u32 bank;
>>  	int ret;
>>  
>> -	for_each_available_child_of_node(dev->of_node, child) {
>> +	for_each_available_child_of_node_scoped(dev->of_node, child) {
>>  		ret = of_property_read_u32(child, "reg", &bank);
>>  		if (ret) {
>>  			dev_err(dev, "could not retrieve reg property: %d\n",
>>  				ret);
>> -			of_node_put(child);
>>  			return ret;
> 			return dev_err_probe(dev, "could not retrieve reg property\n");
> perhaps?

New patch for that... but just mind that deferred probe cannot happen
here, so only part of dev_err_probe() benefits would be used.

Best regards,
Krzysztof


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ