mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 4/7] ARM: legacy: make architecture number unsigned
Date: Wed,  9 Apr 2025 16:01:32 +0200	[thread overview]
Message-ID: <20250409140134.2079552-5-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20250409140134.2079552-1-a.fatoum@pengutronix.de>

The number is effectively unsigned, but we have some places where we
still use int. Switch it over to use unsigned throughout.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/include/asm/armlinux.h |  4 ++--
 arch/arm/lib32/armlinux.c       | 12 ++++++------
 include/bootstrap.h             |  2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/arm/include/asm/armlinux.h b/arch/arm/include/asm/armlinux.h
index 8d8e05105b08..c648ef3d78d0 100644
--- a/arch/arm/include/asm/armlinux.h
+++ b/arch/arm/include/asm/armlinux.h
@@ -9,7 +9,7 @@
 
 #if defined CONFIG_ARM_LINUX && defined CONFIG_CPU_32
 void armlinux_set_bootparams(void *params);
-void armlinux_set_architecture(int architecture);
+void armlinux_set_architecture(unsigned architecture);
 void armlinux_set_revision(unsigned int);
 void armlinux_set_serial(u64);
 #else
@@ -17,7 +17,7 @@ static inline void armlinux_set_bootparams(void *params)
 {
 }
 
-static inline void armlinux_set_architecture(int architecture)
+static inline void armlinux_set_architecture(unsigned architecture)
 {
 }
 
diff --git a/arch/arm/lib32/armlinux.c b/arch/arm/lib32/armlinux.c
index eb30f4a952ee..0b332d23639d 100644
--- a/arch/arm/lib32/armlinux.c
+++ b/arch/arm/lib32/armlinux.c
@@ -30,7 +30,7 @@
 static struct tag *params;
 static void *armlinux_bootparams = NULL;
 
-static int armlinux_architecture;
+static unsigned armlinux_architecture;
 static u32 armlinux_system_rev;
 static u64 armlinux_system_serial;
 
@@ -38,13 +38,13 @@ BAREBOX_MAGICVAR(armlinux_architecture, "ARM machine ID");
 BAREBOX_MAGICVAR(armlinux_system_rev, "ARM system revision");
 BAREBOX_MAGICVAR(armlinux_system_serial, "ARM system serial");
 
-void armlinux_set_architecture(int architecture)
+void armlinux_set_architecture(unsigned architecture)
 {
 	export_env_ull("armlinux_architecture", architecture);
 	armlinux_architecture = architecture;
 }
 
-static int armlinux_get_architecture(void)
+static unsigned armlinux_get_architecture(void)
 {
 	getenv_uint("armlinux_architecture", &armlinux_architecture);
 
@@ -241,7 +241,7 @@ static void setup_tags(unsigned long initrd_address,
 	setup_end_tag();
 
 	printf("commandline: %s\n"
-	       "arch_number: %d\n", commandline, armlinux_get_architecture());
+	       "arch_number: %u\n", commandline, armlinux_get_architecture());
 
 }
 
@@ -251,9 +251,9 @@ void start_linux(void *adr, int swap, unsigned long initrd_address,
 		 unsigned long initrd_size, void *oftree,
 		 enum arm_security_state state, void *optee)
 {
-	void (*kernel)(int zero, int arch, void *params) = adr;
+	void (*kernel)(int zero, unsigned arch, void *params) = adr;
 	void *params = NULL;
-	int architecture;
+	unsigned architecture;
 	int ret;
 
 	if (IS_ENABLED(CONFIG_ARM_SECURE_MONITOR) && state > ARM_STATE_SECURE) {
diff --git a/include/bootstrap.h b/include/bootstrap.h
index 3e006d3cc9f7..801cbeb3da4b 100644
--- a/include/bootstrap.h
+++ b/include/bootstrap.h
@@ -10,7 +10,7 @@
 
 #define bootstrap_err(fmt, arg...) printf(fmt, ##arg)
 
-typedef void (*kernel_entry_func)(int zero, int arch, void *params);
+typedef void (*kernel_entry_func)(int zero, unsigned arch, void *params);
 void bootstrap_boot(kernel_entry_func func, bool barebox);
 
 #ifdef CONFIG_BOOTSTRAP_DEVFS
-- 
2.39.5




  parent reply	other threads:[~2025-04-09 14:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-09 14:01 [PATCH 0/7] ARM: add support for chainloading barebox inside FIP images Ahmad Fatoum
2025-04-09 14:01 ` [PATCH 1/7] fip: add struct fip_image_desc::private_data Ahmad Fatoum
2025-04-09 14:01 ` [PATCH 2/7] fip: mark predefined toc_entries array const Ahmad Fatoum
2025-04-09 14:01 ` [PATCH 3/7] bootm: implement UIMAGE_IS_ADDRESS_VALID helper Ahmad Fatoum
2025-04-09 14:01 ` Ahmad Fatoum [this message]
2025-04-09 14:01 ` [PATCH 5/7] ARM: introduce jump_to_linux helper Ahmad Fatoum
2025-04-09 14:01 ` [PATCH 6/7] ARM: add support for chainloading barebox inside FIP images Ahmad Fatoum
2025-04-09 14:01 ` [PATCH 7/7] ARM: stm32mp: retire non-FIP stm32mp_bbu_mmc_register_handler Ahmad Fatoum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250409140134.2079552-5-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox