[PATCH 1/2] riscv: xip_fixup.h: fix comment typo and whitespace issue

Kunwu Chan kunwu.chan at linux.dev
Fri Feb 13 01:52:40 PST 2026


Fix two minor issues in XIP_FIXUP_OFFSET macro:

- The comment describes the fixup formula as
  "reg += CONFIG_PHYS_RAM_BASE - _start", but the actual assembly
  code subtracts _sdata, not _start. Fix the comment to match.

- Replace spaces with a tab for the "add" instruction to keep
  consistent indentation with surrounding lines.

Reviewed-by: zhouzhouyi <zhouzhouyi at gmail.com>
Signed-off-by: Kunwu Chan <kunwu.chan at linux.dev>
---
 arch/riscv/include/asm/xip_fixup.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/riscv/include/asm/xip_fixup.h b/arch/riscv/include/asm/xip_fixup.h
index f3d56299bc22..56db595b0e14 100644
--- a/arch/riscv/include/asm/xip_fixup.h
+++ b/arch/riscv/include/asm/xip_fixup.h
@@ -16,10 +16,10 @@
 	 *
 	 * The start of data in Flash is _sdata and the start of data in RAM is
 	 * CONFIG_PHYS_RAM_BASE. So this fix-up essentially does this:
-	 * reg += CONFIG_PHYS_RAM_BASE - _start
+	 * reg += CONFIG_PHYS_RAM_BASE - _sdata
 	 */
 	li t0, CONFIG_PHYS_RAM_BASE
-        add \reg, \reg, t0
+	add \reg, \reg, t0
 	la t0, _sdata
 	sub \reg, \reg, t0
 .endm
-- 
2.25.1




More information about the linux-riscv mailing list