binman: Use unsigned long over typedef ulong
PATCH 1/1 binman: Use unsigned long over typedef ulong
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.
--- 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(-)
include/binman_sym.h +4 -4
@@ -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')
tools/binman/test/blob_syms.c +0 -2
@@ -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>
tools/binman/test/u_boot_binman_syms.c +0 -2
@@ -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>
tools/binman/test/u_boot_binman_syms_size.c +0 -2
@@ -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>
Signature · 1 line
2.39.2
Quoted 9 lines · Andrew Davis
The header
binman_sym.hdepends on ulong typedef but does not includetypes.h. This means the header must be included after includingtypes.hor a header that includes it.We could include
types.hbut 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.
Quoted 8 lines
Signed-off-by Andrew Davis <[email protected]>--- 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(-)
Simon Glass
Reviewed-byQuoted 9 lines · Andrew Davis
The header
binman_sym.hdepends on ulong typedef but does not includetypes.h. This means the header must be included after includingtypes.hor a header that includes it.We could include
types.hbut 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.
Quoted 8 lines
Signed-off-by Andrew Davis <[email protected]>--- 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(-)
Applied to u-boot-dm, thanks!