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: <20230313181803.GA524627@electric-eye.fr.zoreil.com>
Date:   Mon, 13 Mar 2023 19:18:03 +0100
From:   Francois Romieu <romieu@...zoreil.com>
To:     Rob Herring <robh@...nel.org>
Cc:     devicetree@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: Use of_property_read_bool() for boolean properties

Rob Herring <robh@...nel.org> :
> It is preferred to use typed property access functions (i.e.
> of_property_read_<type> functions) rather than low-level
> of_get_property/of_find_property functions for reading properties.
> Convert reading boolean properties to to of_property_read_bool().
> 
> Signed-off-by: Rob Herring <robh@...nel.org>
> ---
[...]
>  drivers/net/ethernet/via/via-velocity.c         |  3 +--
[...]
> diff --git a/drivers/net/ethernet/via/via-velocity.c b/drivers/net/ethernet/via/via-velocity.c
> index a502812ac418..86f7843b4591 100644
> --- a/drivers/net/ethernet/via/via-velocity.c
> +++ b/drivers/net/ethernet/via/via-velocity.c
> @@ -2709,8 +2709,7 @@ static int velocity_get_platform_info(struct velocity_info *vptr)
>  	struct resource res;
>  	int ret;
>  
> -	if (of_get_property(vptr->dev->of_node, "no-eeprom", NULL))
> -		vptr->no_eeprom = 1;
> +	vptr->no_eeprom = of_property_read_bool(vptr->dev->of_node, "no-eeprom");
>  
>  	ret = of_address_to_resource(vptr->dev->of_node, 0, &res);
>  	if (ret) {

Acked-by: Francois Romieu <romieu@...zoreil.com>

Simon Horman's comment regarding assignment of bool value to an integer
typed field also apply here.

-- 
Ueimor

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ