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-next>] [day] [month] [year] [list]
Message-Id: <20230319150141.67824-1-robh@kernel.org>
Date:   Sun, 19 Mar 2023 10:01:40 -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 1/2] edac: cpc925: Drop unused memory size DT parsing

The 'total_mem' memory size is parsed from DT, but never used anywhere.
Just drop it as drivers shouldn't really do their own parsing of common
bindings, and memblock would be a better way to get memory size now
anyways.

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

diff --git a/drivers/edac/cpc925_edac.c b/drivers/edac/cpc925_edac.c
index 9797e6d60dde..ee193aae8e14 100644
--- a/drivers/edac/cpc925_edac.c
+++ b/drivers/edac/cpc925_edac.c
@@ -263,7 +263,6 @@ enum brgctrl_bits {
 /* Private structure for edac memory controller */
 struct cpc925_mc_pdata {
 	void __iomem *vbase;
-	unsigned long total_mem;
 	const char *name;
 	int edac_idx;
 };
@@ -280,37 +279,6 @@ struct cpc925_dev_info {
 	void (*check)(struct edac_device_ctl_info *edac_dev);
 };
 
-/* Get total memory size from Open Firmware DTB */
-static void get_total_mem(struct cpc925_mc_pdata *pdata)
-{
-	struct device_node *np = NULL;
-	const unsigned int *reg, *reg_end;
-	int len, sw, aw;
-	unsigned long start, size;
-
-	np = of_find_node_by_type(NULL, "memory");
-	if (!np)
-		return;
-
-	aw = of_n_addr_cells(np);
-	sw = of_n_size_cells(np);
-	reg = (const unsigned int *)of_get_property(np, "reg", &len);
-	reg_end = reg + len/4;
-
-	pdata->total_mem = 0;
-	do {
-		start = of_read_number(reg, aw);
-		reg += aw;
-		size = of_read_number(reg, sw);
-		reg += sw;
-		edac_dbg(1, "start 0x%lx, size 0x%lx\n", start, size);
-		pdata->total_mem += size;
-	} while (reg < reg_end);
-
-	of_node_put(np);
-	edac_dbg(0, "total_mem 0x%lx\n", pdata->total_mem);
-}
-
 static void cpc925_init_csrows(struct mem_ctl_info *mci)
 {
 	struct cpc925_mc_pdata *pdata = mci->pvt_info;
@@ -321,8 +289,6 @@ static void cpc925_init_csrows(struct mem_ctl_info *mci)
 	u32 mbmr, mbbar, bba, grain;
 	unsigned long row_size, nr_pages, last_nr_pages = 0;
 
-	get_total_mem(pdata);
-
 	for (index = 0; index < mci->nr_csrows; index++) {
 		mbmr = __raw_readl(pdata->vbase + REG_MBMR_OFFSET +
 				   0x20 * index);
-- 
2.39.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ