Skip to contentSkip to conversation

MIPS: use more consistent type for memory size values

PATCH Applied Denis Orlov 2 participants 2 messages Jun 23, 2024 – Jul 1, 2024 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: use more consistent type for memory size values

Switch from using u32 to unsigned long for these. It is unlikely to be actually utilized on 64-bit builds, but this feels a bit safer, considering that we work with the whole register width (32 or 64 bit, depending on the config setting) for the corresponding value on the assembly side.

---
 arch/mips/boot/uncompress.c | 6 +++---
 arch/mips/lib/reloc.c       | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
arch/mips/boot/uncompress.c +3 -3
index 9344679a6b..0630d03c6b 100644
@@ -19,14 +19,14 @@ extern void *input_data_end;
 unsigned long free_mem_ptr;
 unsigned long free_mem_end_ptr;
 
-void barebox_pbl_start(void *fdt, void *fdt_end, u32 ram_size);
+void barebox_pbl_start(void *fdt, void *fdt_end, unsigned long ram_size);
 
 void __section(.text_entry) barebox_pbl_start(void *fdt, void *fdt_end,
-					   u32 ram_size)
+					   unsigned long ram_size)
 {
 	u32 piggy_len, fdt_len;
 	void *fdt_new;
-	void (*barebox)(void *fdt, u32 ram_size);
+	void (*barebox)(void *fdt, unsigned long ram_size);
 
 	puts_ll("barebox_pbl_start()\n");
 
arch/mips/lib/reloc.c +2 -2
index ec351b66f7..be8267a0bb 100644
@@ -41,7 +41,7 @@
 #include <asm-generic/memory_layout.h>
 
 void main_entry(void *fdt);
-void __noreturn relocate_code(void *fdt, u32 relocaddr);
+void __noreturn relocate_code(void *fdt, unsigned long ram_size);
 
 /**
  * read_uint() - Read an unsigned integer from the buffer
@@ -106,7 +106,7 @@ static void apply_reloc(unsigned int type, void *addr, long off)
 	}
 }
 
-void __noreturn relocate_code(void *fdt, u32 ram_size)
+void __noreturn relocate_code(void *fdt, unsigned long ram_size)
 {
 	unsigned long addr, length, bss_len, relocaddr, new_stack;
 	uint8_t *buf;
Signature · 1 line
2.45.2
Applied
#1 lore raw
Quoted 8 lines · Denis Orlov

Switch from using u32 to unsigned long for these. It is unlikely to be actually utilized on 64-bit builds, but this feels a bit safer, considering that we work with the whole register width (32 or 64 bit, depending on the config setting) for the corresponding value on the assembly side.

[...]

Applied, thanks!

[1/1] MIPS: use more consistent type for memory size values
https://git.pengutronix.de/cgit/barebox/commit/?id=fe213ae27c4d (link may not be stable)

Best regards,

Signature · 1 line
Sascha Hauer <[email protected]>