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: <4ht5cirpwz3pax5qm72hrjqy6oocsd2jctcwliwc65idijjcjt@fthzfoljm3ys>
Date: Mon, 19 Aug 2024 12:30:51 +0200
From: Marek Behún <kabel@...nel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Cc: Pavel Machek <pavel@....cz>, Lee Jones <lee@...nel.org>, 
	Sean Wang <sean.wang@...iatek.com>, Matthias Brugger <matthias.bgg@...il.com>, 
	AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>, Riku Voipio <riku.voipio@....fi>, 
	Orson Zhai <orsonzhai@...il.com>, Baolin Wang <baolin.wang@...ux.alibaba.com>, 
	Chunyan Zhang <zhang.lyra@...il.com>, Marek Behún <kabel@...nel.org>, 
	linux-leds@...r.kernel.org, linux-kernel@...r.kernel.org, 
	linux-arm-kernel@...ts.infradead.org, linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH 16/17] leds: turris-omnia: Simplify with scoped for each
 OF child loop

Reviewed-by: Marek Behún <kabel@...nel.org>

On Fri, Aug 16, 2024 at 05:31:48PM +0200, Krzysztof Kozlowski 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>
> ---
>  drivers/leds/leds-turris-omnia.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/leds/leds-turris-omnia.c b/drivers/leds/leds-turris-omnia.c
> index 39f740be058f..1ef942b5cefa 100644
> --- a/drivers/leds/leds-turris-omnia.c
> +++ b/drivers/leds/leds-turris-omnia.c
> @@ -452,7 +452,7 @@ static int omnia_mcu_get_features(const struct i2c_client *client)
>  static int omnia_leds_probe(struct i2c_client *client)
>  {
>  	struct device *dev = &client->dev;
> -	struct device_node *np = dev_of_node(dev), *child;
> +	struct device_node *np = dev_of_node(dev);
>  	struct omnia_leds *leds;
>  	struct omnia_led *led;
>  	int ret, count;
> @@ -497,12 +497,10 @@ static int omnia_leds_probe(struct i2c_client *client)
>  	}
>  
>  	led = &leds->leds[0];
> -	for_each_available_child_of_node(np, child) {
> +	for_each_available_child_of_node_scoped(np, child) {
>  		ret = omnia_led_register(client, led, child);
> -		if (ret < 0) {
> -			of_node_put(child);
> +		if (ret < 0)
>  			return ret;
> -		}
>  
>  		led += ret;
>  	}
> 
> -- 
> 2.43.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ