MIPS: use more consistent type for memory size values
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
@@ -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
@@ -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
Sascha Hauer
AppliedQuoted 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]>