[PATCH 02/35] blkcache: Remove unused NEEDS_MANUAL_RELOC code bits

Marek Vasut marek.vasut+renesas at mailbox.org
Wed Sep 6 23:29:42 CEST 2023


The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas at mailbox.org>
---
 cmd/blkcache.c           | 13 -------------
 common/board_r.c         |  3 ---
 drivers/block/blkcache.c | 16 ----------------
 include/blk.h            |  6 ------
 4 files changed, 38 deletions(-)

diff --git a/cmd/blkcache.c b/cmd/blkcache.c
index 47ea1ec0b93..1456654df6f 100644
--- a/cmd/blkcache.c
+++ b/cmd/blkcache.c
@@ -46,24 +46,11 @@ static struct cmd_tbl cmd_blkc_sub[] = {
 	U_BOOT_CMD_MKENT(configure, 3, 0, blkc_configure, "", ""),
 };
 
-static __maybe_unused void blkc_reloc(void)
-{
-	static int relocated;
-
-	if (!relocated) {
-		fixup_cmdtable(cmd_blkc_sub, ARRAY_SIZE(cmd_blkc_sub));
-		relocated = 1;
-	};
-}
-
 static int do_blkcache(struct cmd_tbl *cmdtp, int flag,
 		       int argc, char *const argv[])
 {
 	struct cmd_tbl *c;
 
-#ifdef CONFIG_NEEDS_MANUAL_RELOC
-	blkc_reloc();
-#endif
 	if (argc < 2)
 		return CMD_RET_USAGE;
 
diff --git a/common/board_r.c b/common/board_r.c
index ad9a3cf6336..697d4a5bd3d 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -657,9 +657,6 @@ static init_fnc_t init_sequence_r[] = {
 	initr_watchdog,
 #endif
 	INIT_FUNC_WATCHDOG_RESET
-#if defined(CONFIG_NEEDS_MANUAL_RELOC) && defined(CONFIG_BLOCK_CACHE)
-	blkcache_init,
-#endif
 #ifdef CONFIG_NEEDS_MANUAL_RELOC
 	initr_manual_reloc_cmdtable,
 #endif
diff --git a/drivers/block/blkcache.c b/drivers/block/blkcache.c
index f99465aa479..26bcbea4353 100644
--- a/drivers/block/blkcache.c
+++ b/drivers/block/blkcache.c
@@ -13,10 +13,6 @@
 #include <linux/ctype.h>
 #include <linux/list.h>
 
-#ifdef CONFIG_NEEDS_MANUAL_RELOC
-DECLARE_GLOBAL_DATA_PTR;
-#endif
-
 struct block_cache_node {
 	struct list_head lh;
 	int iftype;
@@ -34,18 +30,6 @@ static struct block_cache_stats _stats = {
 	.max_entries = 32
 };
 
-#ifdef CONFIG_NEEDS_MANUAL_RELOC
-int blkcache_init(void)
-{
-	struct list_head *head = &block_cache;
-
-	head->next = (uintptr_t)head->next + gd->reloc_off;
-	head->prev = (uintptr_t)head->prev + gd->reloc_off;
-
-	return 0;
-}
-#endif
-
 static struct block_cache_node *cache_find(int iftype, int devnum,
 					   lbaint_t start, lbaint_t blkcnt,
 					   unsigned long blksz)
diff --git a/include/blk.h b/include/blk.h
index b819f97c2f1..95e86e2d5d1 100644
--- a/include/blk.h
+++ b/include/blk.h
@@ -105,12 +105,6 @@ struct blk_desc {
 	(PAD_SIZE(size, blk_desc->blksz))
 
 #if CONFIG_IS_ENABLED(BLOCK_CACHE)
-
-/**
- * blkcache_init() - initialize the block cache list pointers
- */
-int blkcache_init(void);
-
 /**
  * blkcache_read() - attempt to read a set of blocks from cache
  *
-- 
2.40.1



More information about the U-Boot mailing list