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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <75ead807-4ad1-4f82-8ce1-dea68ef9d9ab@kernel.org>
Date: Fri, 10 Jan 2025 11:08:47 +0200
From: Roger Quadros <rogerq@...nel.org>
To: "Rob Herring (Arm)" <robh@...nel.org>, Tony Lindgren <tony@...mide.com>,
 Krzysztof Kozlowski <krzk@...nel.org>
Cc: linux-omap@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] memory: omap-gpmc: Use of_property_present() for
 non-boolean properties

Hi Rob,

On 09/01/2025 20:21, Rob Herring (Arm) wrote:
> The use of of_property_read_bool() for non-boolean properties is
> deprecated in favor of of_property_present() when testing for property
> presence.
> 
> While we're here, simplify the 2 checks into a single check as they
> only differ in printing "NAND" vs "OneNAND" in the warning.
> 
> Signed-off-by: Rob Herring (Arm) <robh@...nel.org>
> ---
> Possibly this check could just be removed altogether?

Yes, I agree it is better to just drop these checks.
Let me know if you want me to prepare the path. Thanks.

> ---
>  drivers/memory/omap-gpmc.c | 16 +++-------------
>  1 file changed, 3 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
> index e2a75a52563f..329bad46065c 100644
> --- a/drivers/memory/omap-gpmc.c
> +++ b/drivers/memory/omap-gpmc.c
> @@ -2226,21 +2226,11 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
>  		goto err;
>  	}
>  
> -	if (of_node_name_eq(child, "nand")) {
> +	if (of_node_name_eq(child, "nand") || of_node_name_eq(child, "onenand")) {
>  		/* Warn about older DT blobs with no compatible property */
> -		if (!of_property_read_bool(child, "compatible")) {
> +		if (!of_property_present(child, "compatible")) {
>  			dev_warn(&pdev->dev,
> -				 "Incompatible NAND node: missing compatible");
> -			ret = -EINVAL;
> -			goto err;
> -		}
> -	}
> -
> -	if (of_node_name_eq(child, "onenand")) {
> -		/* Warn about older DT blobs with no compatible property */
> -		if (!of_property_read_bool(child, "compatible")) {
> -			dev_warn(&pdev->dev,
> -				 "Incompatible OneNAND node: missing compatible");
> +				 "Incompatible '%pOFn' node: missing compatible", child);
>  			ret = -EINVAL;
>  			goto err;
>  		}

-- 
cheers,
-roger


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ