public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] binman: Use unsigned long over typedef ulong
@ 2023-04-04 18:45 Andrew Davis
  2023-04-05 18:38 ` Simon Glass
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Davis @ 2023-04-04 18:45 UTC (permalink / raw)
  To: Simon Glass, Tom Rini, u-boot; +Cc: Andrew Davis

The header binman_sym.h depends on ulong typedef but does not include
types.h. This means the header must be included after including types.h
or a header that includes it.

We could include types.h but instead let's just switch from ulong
to directly using unsigned long. This removes the need for typedef'ing
it in some of the tests, so also remove those.

Signed-off-by: Andrew Davis <afd@ti.com>
---
 include/binman_sym.h                        | 8 ++++----
 tools/binman/test/blob_syms.c               | 2 --
 tools/binman/test/u_boot_binman_syms.c      | 2 --
 tools/binman/test/u_boot_binman_syms_size.c | 2 --
 4 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/include/binman_sym.h b/include/binman_sym.h
index 528d7e4e90e..49a95eafade 100644
--- a/include/binman_sym.h
+++ b/include/binman_sym.h
@@ -71,7 +71,7 @@
  * value #defined above. This is used to check at runtime if the
  * symbol values were filled in and are OK to use.
  */
-extern ulong _binman_sym_magic;
+extern unsigned long _binman_sym_magic;
 
 /**
  * DECLARE_BINMAN_MAGIC_SYM - Declare the internal magic symbol
@@ -81,7 +81,7 @@ extern ulong _binman_sym_magic;
  * definitions of the symbol.
  */
 #define DECLARE_BINMAN_MAGIC_SYM \
-	ulong _binman_sym_magic \
+	unsigned long _binman_sym_magic \
 		__attribute__((aligned(4), section(".binman_sym")))
 
 /**
@@ -93,14 +93,14 @@ extern ulong _binman_sym_magic;
  * Return: 1 if binman symbol values are usable, 0 if not
  */
 #define BINMAN_SYMS_OK \
-	(*(ulong *)&_binman_sym_magic == BINMAN_SYM_MAGIC_VALUE)
+	(*(unsigned long *)&_binman_sym_magic == BINMAN_SYM_MAGIC_VALUE)
 
 /**
  * binman_sym() - Access a previously declared symbol
  *
  * This is used to get the value of a symbol. E.g.:
  *
- *    ulong address = binman_sym(ulong, u_boot_spl, pos);
+ *    unsigned long address = binman_sym(unsigned long, u_boot_spl, pos);
  *
  * @_type: Type f the symbol (e.g. unsigned long)
  * @entry_name: Name of the entry to look for (e.g. 'u_boot_spl')
diff --git a/tools/binman/test/blob_syms.c b/tools/binman/test/blob_syms.c
index d652c79aa98..1df8d64353f 100644
--- a/tools/binman/test/blob_syms.c
+++ b/tools/binman/test/blob_syms.c
@@ -5,8 +5,6 @@
  * Simple program to create some binman symbols. This is used by binman tests.
  */
 
-typedef unsigned long ulong;
-
 #include <linux/kconfig.h>
 #include <binman_sym.h>
 
diff --git a/tools/binman/test/u_boot_binman_syms.c b/tools/binman/test/u_boot_binman_syms.c
index ed761246aec..147c90230f8 100644
--- a/tools/binman/test/u_boot_binman_syms.c
+++ b/tools/binman/test/u_boot_binman_syms.c
@@ -5,8 +5,6 @@
  * Simple program to create some binman symbols. This is used by binman tests.
  */
 
-typedef unsigned long ulong;
-
 #include <linux/kconfig.h>
 #include <binman_sym.h>
 
diff --git a/tools/binman/test/u_boot_binman_syms_size.c b/tools/binman/test/u_boot_binman_syms_size.c
index fa41b3d9a33..f686892a4da 100644
--- a/tools/binman/test/u_boot_binman_syms_size.c
+++ b/tools/binman/test/u_boot_binman_syms_size.c
@@ -5,8 +5,6 @@
  * Simple program to create some binman symbols. This is used by binman tests.
  */
 
-typedef unsigned long ulong;
-
 #include <linux/kconfig.h>
 #include <binman_sym.h>
 
-- 
2.39.2


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

* Re: [PATCH] binman: Use unsigned long over typedef ulong
  2023-04-04 18:45 [PATCH] binman: Use unsigned long over typedef ulong Andrew Davis
@ 2023-04-05 18:38 ` Simon Glass
  2023-04-22 16:51   ` Simon Glass
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Glass @ 2023-04-05 18:38 UTC (permalink / raw)
  To: Andrew Davis; +Cc: Tom Rini, u-boot

On Wed, 5 Apr 2023 at 06:45, Andrew Davis <afd@ti.com> wrote:
>
> The header binman_sym.h depends on ulong typedef but does not include
> types.h. This means the header must be included after including types.h
> or a header that includes it.
>
> We could include types.h but instead let's just switch from ulong
> to directly using unsigned long. This removes the need for typedef'ing
> it in some of the tests, so also remove those.
>
> Signed-off-by: Andrew Davis <afd@ti.com>
> ---
>  include/binman_sym.h                        | 8 ++++----
>  tools/binman/test/blob_syms.c               | 2 --
>  tools/binman/test/u_boot_binman_syms.c      | 2 --
>  tools/binman/test/u_boot_binman_syms_size.c | 2 --
>  4 files changed, 4 insertions(+), 10 deletions(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>

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

* Re: [PATCH] binman: Use unsigned long over typedef ulong
  2023-04-05 18:38 ` Simon Glass
@ 2023-04-22 16:51   ` Simon Glass
  0 siblings, 0 replies; 3+ messages in thread
From: Simon Glass @ 2023-04-22 16:51 UTC (permalink / raw)
  To: Simon Glass; +Cc: Tom Rini, u-boot, Andrew Davis

On Wed, 5 Apr 2023 at 06:45, Andrew Davis <afd@ti.com> wrote:
>
> The header binman_sym.h depends on ulong typedef but does not include
> types.h. This means the header must be included after including types.h
> or a header that includes it.
>
> We could include types.h but instead let's just switch from ulong
> to directly using unsigned long. This removes the need for typedef'ing
> it in some of the tests, so also remove those.
>
> Signed-off-by: Andrew Davis <afd@ti.com>
> ---
>  include/binman_sym.h                        | 8 ++++----
>  tools/binman/test/blob_syms.c               | 2 --
>  tools/binman/test/u_boot_binman_syms.c      | 2 --
>  tools/binman/test/u_boot_binman_syms_size.c | 2 --
>  4 files changed, 4 insertions(+), 10 deletions(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot-dm, thanks!

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

end of thread, other threads:[~2023-04-22 16:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-04 18:45 [PATCH] binman: Use unsigned long over typedef ulong Andrew Davis
2023-04-05 18:38 ` Simon Glass
2023-04-22 16:51   ` Simon Glass

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