summaryrefslogtreecommitdiff
path: root/arch/sh/lib/board.c
diff options
context:
space:
mode:
authorJerome Forissier <jerome.forissier@linaro.org>2025-04-04 15:50:36 +0200
committerTom Rini <trini@konsulko.com>2025-04-14 08:59:39 -0600
commit6c171f7a184cc2815b736c48aa6ac02367bbb67f (patch)
tree90ce80009624aea04af30f74d6e28dcf5f83ee9e /arch/sh/lib/board.c
parent6fe50e39508043f386fc1bd40bbc02b8a75c1940 (diff)
common: board: make initcalls static
Change board_init_f(), board_init_f_r() and board_init_r() to make static calls instead of iterating over the init_sequence_f, init_sequence_f_r and init_sequence_r arrays, respectively. This makes the code a simpler (and even more so when initcall_run_list() is later removed) and it reduces the binary size as well. Tested with xilinx_zynqmp_kria_defconfig; bloat-o-meter results: - With LTO add/remove: 106/196 grow/shrink: 10/28 up/down: 31548/-33829 (-2281) Total: Before=1070471, After=1068190, chg -0.21% - Without LTO add/remove: 0/54 grow/shrink: 3/0 up/down: 2322/-2832 (-510) Total: Before=1121723, After=1121213, chg -0.05% Execution time does not change in a noticeable way. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Diffstat (limited to 'arch/sh/lib/board.c')
-rw-r--r--arch/sh/lib/board.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c
index 53b1c147c2e..2daf54e7c33 100644
--- a/arch/sh/lib/board.c
+++ b/arch/sh/lib/board.c
@@ -19,18 +19,13 @@ int dram_init(void)
void relocate_code(ulong start_addr_sp, gd_t *new_gd, ulong relocaddr)
{
- void (*reloc_board_init_r)(gd_t *gd, ulong dest) = board_init_r;
-
- if (new_gd->reloc_off) {
+ if (new_gd->reloc_off)
memcpy((void *)new_gd->relocaddr,
(void *)(new_gd->relocaddr - new_gd->reloc_off),
new_gd->mon_len);
- reloc_board_init_r += new_gd->reloc_off;
- }
-
__asm__ __volatile__("mov.l %0, r15\n" : : "m" (new_gd->start_addr_sp));
while (1)
- reloc_board_init_r(new_gd, 0x0);
+ board_init_r(new_gd, 0x0);
}