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: <20230319150141.67824-2-robh@kernel.org>
Date:   Sun, 19 Mar 2023 10:01:41 -0500
From:   Rob Herring <robh@...nel.org>
To:     Borislav Petkov <bp@...en8.de>, Tony Luck <tony.luck@...el.com>,
        James Morse <james.morse@....com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Robert Richter <rric@...nel.org>
Cc:     linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] edac: cpc925: Use of_get_cpu_hwid() to read CPU node 'reg'

Replace open coded reading of CPU nodes' "reg" properties with
of_get_cpu_hwid() dedicated for this purpose.

Signed-off-by: Rob Herring <robh@...nel.org>
---
 drivers/edac/cpc925_edac.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/edac/cpc925_edac.c b/drivers/edac/cpc925_edac.c
index ee193aae8e14..0182436c1b5a 100644
--- a/drivers/edac/cpc925_edac.c
+++ b/drivers/edac/cpc925_edac.c
@@ -557,13 +557,13 @@ static u32 cpc925_cpu_mask_disabled(void)
 	mask = APIMASK_ADI0 | APIMASK_ADI1;
 
 	for_each_of_cpu_node(cpunode) {
-		const u32 *reg = of_get_property(cpunode, "reg", NULL);
-		if (reg == NULL || *reg > 2) {
+		int hwid = of_get_cpu_hwid(cpunode, 0);
+		if ((hwid < 0) || (hwid > 2)) {
 			cpc925_printk(KERN_ERR, "Bad reg value at %pOF\n", cpunode);
 			continue;
 		}
 
-		mask &= ~APIMASK_ADI(*reg);
+		mask &= ~APIMASK_ADI(hwid);
 	}
 
 	if (mask != (APIMASK_ADI0 | APIMASK_ADI1)) {
-- 
2.39.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ