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: <1fdf00a0-4830-465a-801c-147472fdcd22@mercury.local>
Date:   Sun, 12 Mar 2023 23:36:09 +0100
From:   Sebastian Reichel <sebastian.reichel@...labora.com>
To:     Rob Herring <robh@...nel.org>
Cc:     devicetree@...r.kernel.org, linux-pm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] power: supply: charger-manager: Use
 of_property_read_bool() for boolean properties

Hi,

On Fri, Mar 10, 2023 at 08:47:35AM -0600, Rob Herring wrote:
> 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>
> ---

Thanks, queued.

-- Sebastian

>  drivers/power/supply/charger-manager.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c
> index c9e8450c646f..5fa6ba7f41e1 100644
> --- a/drivers/power/supply/charger-manager.c
> +++ b/drivers/power/supply/charger-manager.c
> @@ -1331,7 +1331,7 @@ static struct charger_desc *of_cm_parse_desc(struct device *dev)
>  	of_property_read_string(np, "cm-thermal-zone", &desc->thermal_zone);
>  
>  	of_property_read_u32(np, "cm-battery-cold", &desc->temp_min);
> -	if (of_get_property(np, "cm-battery-cold-in-minus", NULL))
> +	if (of_property_read_bool(np, "cm-battery-cold-in-minus"))
>  		desc->temp_min *= -1;
>  	of_property_read_u32(np, "cm-battery-hot", &desc->temp_max);
>  	of_property_read_u32(np, "cm-battery-temp-diff", &desc->temp_diff);
> -- 
> 2.39.2
> 

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ