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] [day] [month] [year] [list]
Message-ID: <aVKfuq2mzalZJp7d@lizhi-Precision-Tower-5810>
Date: Mon, 29 Dec 2025 10:35:22 -0500
From: Frank Li <Frank.li@....com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@....qualcomm.com>
Cc: Alexandre Belloni <alexandre.belloni@...tlin.com>,
	linux-i3c@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] i3c: master: Simplify with scoped for each OF child loop

On Wed, Dec 24, 2025 at 01:45:52PM +0100, Krzysztof Kozlowski wrote:
> Use scoped for-each loop when iterating over device nodes to make code a
> bit simpler.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@....qualcomm.com>
> ---

Reviewed-by: Frank Li <Frank.Li@....com>

>  drivers/i3c/master.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
> index 7f606c871648..b789ac390937 100644
> --- a/drivers/i3c/master.c
> +++ b/drivers/i3c/master.c
> @@ -2370,19 +2370,16 @@ static int of_populate_i3c_bus(struct i3c_master_controller *master)
>  {
>  	struct device *dev = &master->dev;
>  	struct device_node *i3cbus_np = dev->of_node;
> -	struct device_node *node;
>  	int ret;
>  	u32 val;
>
>  	if (!i3cbus_np)
>  		return 0;
>
> -	for_each_available_child_of_node(i3cbus_np, node) {
> +	for_each_available_child_of_node_scoped(i3cbus_np, node) {
>  		ret = of_i3c_master_add_dev(master, node);
> -		if (ret) {
> -			of_node_put(node);
> +		if (ret)
>  			return ret;
> -		}
>  	}
>
>  	/*
> --
> 2.51.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ