mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] MIPS: use more consistent type for memory size values
@ 2024-06-23 20:46 Denis Orlov
  2024-07-01 12:12 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Denis Orlov @ 2024-06-23 20:46 UTC (permalink / raw)
  To: barebox; +Cc: 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.

Signed-off-by: Denis Orlov <denorl2009@gmail.com>
---
 arch/mips/boot/uncompress.c | 6 +++---
 arch/mips/lib/reloc.c       | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/mips/boot/uncompress.c b/arch/mips/boot/uncompress.c
index 9344679a6b..0630d03c6b 100644
--- a/arch/mips/boot/uncompress.c
+++ b/arch/mips/boot/uncompress.c
@@ -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");
 
diff --git a/arch/mips/lib/reloc.c b/arch/mips/lib/reloc.c
index ec351b66f7..be8267a0bb 100644
--- a/arch/mips/lib/reloc.c
+++ b/arch/mips/lib/reloc.c
@@ -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;
-- 
2.45.2




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] MIPS: use more consistent type for memory size values
  2024-06-23 20:46 [PATCH] MIPS: use more consistent type for memory size values Denis Orlov
@ 2024-07-01 12:12 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2024-07-01 12:12 UTC (permalink / raw)
  To: barebox, Denis Orlov


On Sun, 23 Jun 2024 23:46:53 +0300, Denis Orlov wrote:
> 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,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-07-01 12:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-23 20:46 [PATCH] MIPS: use more consistent type for memory size values Denis Orlov
2024-07-01 12:12 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox