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: <18f714f9-1369-4029-b036-3c176377374e@microchip.com>
Date: Tue, 27 Aug 2024 12:30:34 +0200
From: Nicolas Ferre <nicolas.ferre@...rochip.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>, Krzysztof Kozlowski
	<krzk@...nel.org>, 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>
CC: <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>,
	Jonathan Cameron <Jonathan.Cameron@...wei.com>
Subject: Re: [PATCH v2 02/13] memory: atmel-ebi: simplify with scoped for each
 OF child loop

On 16/08/2024 at 12:54, Krzysztof Kozlowski wrote:
> Use scoped for_each_available_child_of_node_scoped() when iterating over
> device nodes to make code a bit simpler.
> 
> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>

Acked-by: Nicolas Ferre <nicolas.ferre@...rochip.com>
Thanks!
Regards,
   Nicolas

> ---
>   drivers/memory/atmel-ebi.c | 8 +++-----
>   1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/memory/atmel-ebi.c b/drivers/memory/atmel-ebi.c
> index 8f5b3302ee30..8db970da9af9 100644
> --- a/drivers/memory/atmel-ebi.c
> +++ b/drivers/memory/atmel-ebi.c
> @@ -518,7 +518,7 @@ static int atmel_ebi_dev_disable(struct atmel_ebi *ebi, struct device_node *np)
>   static int atmel_ebi_probe(struct platform_device *pdev)
>   {
>          struct device *dev = &pdev->dev;
> -       struct device_node *child, *np = dev->of_node;
> +       struct device_node *np = dev->of_node;
>          struct atmel_ebi *ebi;
>          int ret, reg_cells;
>          struct clk *clk;
> @@ -592,7 +592,7 @@ static int atmel_ebi_probe(struct platform_device *pdev)
> 
>          reg_cells += val;
> 
> -       for_each_available_child_of_node(np, child) {
> +       for_each_available_child_of_node_scoped(np, child) {
>                  if (!of_property_present(child, "reg"))
>                          continue;
> 
> @@ -602,10 +602,8 @@ static int atmel_ebi_probe(struct platform_device *pdev)
>                                  child);
> 
>                          ret = atmel_ebi_dev_disable(ebi, child);
> -                       if (ret) {
> -                               of_node_put(child);
> +                       if (ret)
>                                  return ret;
> -                       }
>                  }
>          }
> 
> 
> --
> 2.43.0
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ