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: <20240126235425.12233-47-quic_obabatun@quicinc.com>
Date: Fri, 26 Jan 2024 15:54:25 -0800
From: Oreoluwa Babatunde <quic_obabatun@...cinc.com>
To: <catalin.marinas@....com>, <will@...nel.org>, <robh+dt@...nel.org>,
        <frowand.list@...il.com>, <vgupta@...nel.org>, <arnd@...db.de>,
        <olof@...om.net>, <soc@...nel.org>, <guoren@...nel.org>,
        <monstr@...str.eu>, <palmer@...belt.com>, <aou@...s.berkeley.edu>,
        <dinguyen@...nel.org>, <chenhuacai@...nel.org>,
        <tsbogend@...ha.franken.de>, <jonas@...thpole.se>,
        <stefan.kristiansson@...nalahti.fi>, <shorne@...il.com>,
        <mpe@...erman.id.au>, <ysato@...rs.sourceforge.jp>, <dalias@...c.org>,
        <glaubitz@...sik.fu-berlin.de>, <richard@....at>,
        <anton.ivanov@...bridgegreys.com>, <johannes@...solutions.net>,
        <chris@...kel.net>, <jcmvbkbc@...il.com>
CC: <linux-arm-kernel@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
        <devicetree@...r.kernel.org>, <linux-arm-msm@...r.kernel.org>,
        <kernel@...cinc.com>, Oreoluwa Babatunde <quic_obabatun@...cinc.com>
Subject: [PATCH 46/46] of: reserved_mem: Delete the fdt_init_reserved_mem() function

Delete the fdt_init_reserved_mem() function as all architectures have
been switched to using dt_init_reserved_mem(), which is basically a copy
of the function, but uses the unflatten devicetree APIs instead of the
fdt APIs.

Signed-off-by: Oreoluwa Babatunde <quic_obabatun@...cinc.com>
---
 drivers/of/of_reserved_mem.c    | 54 ---------------------------------
 include/linux/of_reserved_mem.h |  3 --
 2 files changed, 57 deletions(-)

diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
index 3650efab0afd..3d1ab2325217 100644
--- a/drivers/of/of_reserved_mem.c
+++ b/drivers/of/of_reserved_mem.c
@@ -382,60 +382,6 @@ static void __init __rmem_check_for_overlap(void)
 	}
 }
 
-/**
- * fdt_init_reserved_mem() - allocate and init all saved reserved memory regions
- */
-void __init fdt_init_reserved_mem(void)
-{
-	int i, ret;
-
-	ret = alloc_reserved_mem_array();
-	if (ret)
-		pr_err("Failed to allocate memory for reserved_mem array with err: %d", ret);
-
-	dt_scan_reserved_mem_reg_nodes();
-
-	/* check for overlapping reserved regions */
-	__rmem_check_for_overlap();
-
-	for (i = 0; i < reserved_mem_count; i++) {
-		struct reserved_mem *rmem = &reserved_mem[i];
-		struct device_node *node = rmem->dev_node;
-		int len;
-		const __be32 *prop;
-		int err = 0;
-		bool nomap;
-
-		nomap = of_get_property(node, "no-map", NULL) != NULL;
-		prop = of_get_property(node, "phandle", &len);
-		if (!prop)
-			prop = of_get_property(node, "linux,phandle", &len);
-		if (prop)
-			rmem->phandle = of_read_number(prop, len/4);
-
-		err = __reserved_mem_init_node(rmem);
-		if (err != 0 && err != -ENOENT) {
-			pr_info("node %s compatible matching fail\n",
-				rmem->name);
-			if (nomap)
-				memblock_clear_nomap(rmem->base, rmem->size);
-			else
-				memblock_phys_free(rmem->base,
-						   rmem->size);
-		} else {
-			phys_addr_t end = rmem->base + rmem->size - 1;
-			bool reusable =
-				(of_get_property(node, "reusable", NULL)) != NULL;
-
-			pr_info("%pa..%pa (%lu KiB) %s %s %s\n",
-				&rmem->base, &end, (unsigned long)(rmem->size / SZ_1K),
-				nomap ? "nomap" : "map",
-				reusable ? "reusable" : "non-reusable",
-				rmem->name ? rmem->name : "unknown");
-		}
-	}
-}
-
 /**
  * dt_init_reserved_mem() - allocate and init all saved reserved memory regions
  */
diff --git a/include/linux/of_reserved_mem.h b/include/linux/of_reserved_mem.h
index b1f71a4894aa..dd67b9b2488e 100644
--- a/include/linux/of_reserved_mem.h
+++ b/include/linux/of_reserved_mem.h
@@ -33,7 +33,6 @@ typedef int (*reservedmem_of_init_fn)(struct reserved_mem *rmem);
 	_OF_DECLARE(reservedmem, name, compat, init, reservedmem_of_init_fn)
 
 void dt_init_reserved_mem(void);
-void fdt_init_reserved_mem(void);
 int of_reserved_mem_device_init_by_idx(struct device *dev,
 				       struct device_node *np, int idx);
 int of_reserved_mem_device_init_by_name(struct device *dev,
@@ -50,8 +49,6 @@ struct reserved_mem *of_reserved_mem_lookup(struct device_node *np);
 
 static inline void dt_init_reserved_mem(void) { }
 
-static inline void fdt_init_reserved_mem(void) { }
-
 static inline int of_reserved_mem_device_init_by_idx(struct device *dev,
 					struct device_node *np, int idx)
 {
-- 
2.17.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ