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: <CAJM55Z_X4A_FO1OrA=3jC9+uYhs-Pe0zFSxavFJv3orOka9CdA@mail.gmail.com>
Date: Tue, 11 Feb 2025 01:20:54 -0800
From: Emil Renner Berthing <emil.renner.berthing@...onical.com>
To: Alexandre Ghiti <alex@...ti.fr>, 
	Emil Renner Berthing <emil.renner.berthing@...onical.com>, linux-riscv@...ts.infradead.org
Cc: Steffen Persvold <spersvold@...il.com>, Paul Walmsley <paul.walmsley@...ive.com>, 
	linux-kernel@...r.kernel.org, Jeremy Linton <jeremy.linton@....com>, 
	Conor Dooley <conor.dooley@...rochip.com>, Palmer Dabbelt <palmer@...belt.com>, 
	Yunhui Cui <cuiyunhui@...edance.com>, Sudeep Holla <sudeep.holla@....com>, 
	Miquel Sabaté Solà <mikisabate@...il.com>, 
	Rob Herring <robh@...nel.org>
Subject: Re: [PATCH v1] riscv: Use of_property_present() to test for
 non-boolean properties

Alexandre Ghiti wrote:
> Hi Emil,
>
> On 05/02/2025 15:39, Emil Renner Berthing wrote:
> > The use of of_property_read_bool() for non-boolean properties is
> > deprecated and since
> >
> > commit c141ecc3cecd ("of: Warn when of_property_read_bool() is used on non-boolean properties")
> >
> > a warning is displayed when used incorrectly. Fix it by switching to
> > of_property_present() as recommended in the same commit.
> >
> > Signed-off-by: Emil Renner Berthing <emil.renner.berthing@...onical.com>
> > ---
> >   arch/riscv/kernel/cacheinfo.c | 12 ++++++------
> >   1 file changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/arch/riscv/kernel/cacheinfo.c b/arch/riscv/kernel/cacheinfo.c
> > index 2d40736fc37c..26b085dbdd07 100644
> > --- a/arch/riscv/kernel/cacheinfo.c
> > +++ b/arch/riscv/kernel/cacheinfo.c
> > @@ -108,11 +108,11 @@ int populate_cache_leaves(unsigned int cpu)
> >   	if (!np)
> >   		return -ENOENT;
> >
> > -	if (of_property_read_bool(np, "cache-size"))
> > +	if (of_property_present(np, "cache-size"))
> >   		ci_leaf_init(this_leaf++, CACHE_TYPE_UNIFIED, level);
> > -	if (of_property_read_bool(np, "i-cache-size"))
> > +	if (of_property_present(np, "i-cache-size"))
> >   		ci_leaf_init(this_leaf++, CACHE_TYPE_INST, level);
> > -	if (of_property_read_bool(np, "d-cache-size"))
> > +	if (of_property_present(np, "d-cache-size"))
> >   		ci_leaf_init(this_leaf++, CACHE_TYPE_DATA, level);
> >
> >   	prev = np;
> > @@ -125,11 +125,11 @@ int populate_cache_leaves(unsigned int cpu)
> >   			break;
> >   		if (level <= levels)
> >   			break;
> > -		if (of_property_read_bool(np, "cache-size"))
> > +		if (of_property_present(np, "cache-size"))
> >   			ci_leaf_init(this_leaf++, CACHE_TYPE_UNIFIED, level);
> > -		if (of_property_read_bool(np, "i-cache-size"))
> > +		if (of_property_present(np, "i-cache-size"))
> >   			ci_leaf_init(this_leaf++, CACHE_TYPE_INST, level);
> > -		if (of_property_read_bool(np, "d-cache-size"))
> > +		if (of_property_present(np, "d-cache-size"))
> >   			ci_leaf_init(this_leaf++, CACHE_TYPE_DATA, level);
> >   		levels = level;
> >   	}
>
>
> The same patch has been on the ML since last november:
>
> https://lore.kernel.org/linux-riscv/20241104190314.270095-1-robh@kernel.org/
>
> And was already re-sent once end of december...

Yeah I saw that later, but it would still be great to have this applied in 6.14
so we don't get all those warnings at boot.

/Emil

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ