diff options
author | Simon Glass <sjg@chromium.org> | 2020-05-10 11:40:03 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-05-18 18:36:55 -0400 |
commit | 09140113108541b95d340f3c7b6ee597d31ccc73 (patch) | |
tree | 4b4241b799bbbb2eeef4164392442b193af1703f /test | |
parent | 691d719db7183dfb1d1360efed4c5e9f6899095f (diff) | |
download | u-boot-09140113108541b95d340f3c7b6ee597d31ccc73.tar.gz |
command: Remove the cmd_tbl_t typedef
We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.
Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.
This requires quite a few header-file additions.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/bloblist.c | 3 | ||||
-rw-r--r-- | test/cmd_ut.c | 14 | ||||
-rw-r--r-- | test/command_ut.c | 4 | ||||
-rw-r--r-- | test/compression.c | 3 | ||||
-rw-r--r-- | test/dm/test-main.c | 2 | ||||
-rw-r--r-- | test/env/cmd_ut_env.c | 2 | ||||
-rw-r--r-- | test/lib/cmd_ut_lib.c | 2 | ||||
-rw-r--r-- | test/log/log_test.c | 3 | ||||
-rw-r--r-- | test/log/test-main.c | 2 | ||||
-rw-r--r-- | test/optee/cmd_ut_optee.c | 2 | ||||
-rw-r--r-- | test/overlay/cmd_ut_overlay.c | 2 | ||||
-rw-r--r-- | test/print_ut.c | 3 | ||||
-rw-r--r-- | test/str_ut.c | 2 | ||||
-rw-r--r-- | test/time_ut.c | 2 | ||||
-rw-r--r-- | test/unicode_ut.c | 2 |
15 files changed, 28 insertions, 20 deletions
diff --git a/test/bloblist.c b/test/bloblist.c index bdcca0291c7..4e537ee1b9c 100644 --- a/test/bloblist.c +++ b/test/bloblist.c @@ -234,7 +234,8 @@ static int bloblist_test_checksum(struct unit_test_state *uts) BLOBLIST_TEST(bloblist_test_checksum, 0); -int do_ut_bloblist(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) +int do_ut_bloblist(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) { struct unit_test *tests = ll_entry_start(struct unit_test, bloblist_test); diff --git a/test/cmd_ut.c b/test/cmd_ut.c index bd20a69c552..cc9543c315c 100644 --- a/test/cmd_ut.c +++ b/test/cmd_ut.c @@ -9,11 +9,12 @@ #include <test/suites.h> #include <test/test.h> -static int do_ut_all(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); +static int do_ut_all(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]); int cmd_ut_category(const char *name, const char *prefix, struct unit_test *tests, int n_ents, - int argc, char * const argv[]) + int argc, char *const argv[]) { struct unit_test_state uts = { .fail_count = 0 }; struct unit_test *test; @@ -43,7 +44,7 @@ int cmd_ut_category(const char *name, const char *prefix, return uts.fail_count ? CMD_RET_FAILURE : 0; } -static cmd_tbl_t cmd_ut_sub[] = { +static struct cmd_tbl cmd_ut_sub[] = { U_BOOT_CMD_MKENT(all, CONFIG_SYS_MAXARGS, 1, do_ut_all, "", ""), #if defined(CONFIG_UT_DM) U_BOOT_CMD_MKENT(dm, CONFIG_SYS_MAXARGS, 1, do_ut_dm, "", ""), @@ -79,7 +80,8 @@ static cmd_tbl_t cmd_ut_sub[] = { #endif }; -static int do_ut_all(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +static int do_ut_all(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) { int i; int retval; @@ -95,9 +97,9 @@ static int do_ut_all(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return any_fail; } -static int do_ut(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +static int do_ut(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { - cmd_tbl_t *cp; + struct cmd_tbl *cp; if (argc < 2) return CMD_RET_USAGE; diff --git a/test/command_ut.c b/test/command_ut.c index 8e268e5ee52..d6e6777bd42 100644 --- a/test/command_ut.c +++ b/test/command_ut.c @@ -7,12 +7,14 @@ #include <common.h> #include <command.h> +#include <env.h> static const char test_cmd[] = "setenv list 1\n setenv list ${list}2; " "setenv list ${list}3\0" "setenv list ${list}4"; -static int do_ut_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +static int do_ut_cmd(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) { printf("%s: Testing commands\n", __func__); run_command("env default -f -a", 0); diff --git a/test/compression.c b/test/compression.c index bceb2c273c7..0b57b7bb406 100644 --- a/test/compression.c +++ b/test/compression.c @@ -535,7 +535,8 @@ static int compression_test_bootm_none(struct unit_test_state *uts) } COMPRESSION_TEST(compression_test_bootm_none, 0); -int do_ut_compression(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +int do_ut_compression(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) { struct unit_test *tests = ll_entry_start(struct unit_test, compression_test); diff --git a/test/dm/test-main.c b/test/dm/test-main.c index d7dc8d1f915..62a0c692c89 100644 --- a/test/dm/test-main.c +++ b/test/dm/test-main.c @@ -200,7 +200,7 @@ static int dm_test_main(const char *test_name) return uts->fail_count ? CMD_RET_FAILURE : 0; } -int do_ut_dm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +int do_ut_dm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { const char *test_name = NULL; diff --git a/test/env/cmd_ut_env.c b/test/env/cmd_ut_env.c index ad67dbe7929..a440b1bfb0e 100644 --- a/test/env/cmd_ut_env.c +++ b/test/env/cmd_ut_env.c @@ -10,7 +10,7 @@ #include <test/suites.h> #include <test/ut.h> -int do_ut_env(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +int do_ut_env(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { struct unit_test *tests = ll_entry_start(struct unit_test, env_test); const int n_ents = ll_entry_count(struct unit_test, env_test); diff --git a/test/lib/cmd_ut_lib.c b/test/lib/cmd_ut_lib.c index c73e8d7b05a..f5c7bf3d3b0 100644 --- a/test/lib/cmd_ut_lib.c +++ b/test/lib/cmd_ut_lib.c @@ -11,7 +11,7 @@ #include <test/suites.h> #include <test/ut.h> -int do_ut_lib(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +int do_ut_lib(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { struct unit_test *tests = ll_entry_start(struct unit_test, lib_test); const int n_ents = ll_entry_count(struct unit_test, lib_test); diff --git a/test/log/log_test.c b/test/log/log_test.c index febc2c1252a..d29b559410f 100644 --- a/test/log/log_test.c +++ b/test/log/log_test.c @@ -7,6 +7,7 @@ */ #include <common.h> +#include <command.h> /* emit some sample log records in different ways, for testing */ static int log_run(enum uclass_id cat, const char *file) @@ -200,7 +201,7 @@ static int log_test(int testnum) } #ifdef CONFIG_LOG_TEST -int do_log_test(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) +int do_log_test(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { int testnum = 0; int ret; diff --git a/test/log/test-main.c b/test/log/test-main.c index 855de47f337..faf920d8e90 100644 --- a/test/log/test-main.c +++ b/test/log/test-main.c @@ -10,7 +10,7 @@ #include <test/log.h> #include <test/suites.h> -int do_ut_log(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +int do_ut_log(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]) { struct unit_test *tests = ll_entry_start(struct unit_test, log_test); const int n_ents = ll_entry_count(struct unit_test, log_test); diff --git a/test/optee/cmd_ut_optee.c b/test/optee/cmd_ut_optee.c index 092710326a8..01f829756fd 100644 --- a/test/optee/cmd_ut_optee.c +++ b/test/optee/cmd_ut_optee.c @@ -91,7 +91,7 @@ static int optee_fdt_protected_memory(struct unit_test_state *uts) } OPTEE_TEST(optee_fdt_protected_memory, 0); -int do_ut_optee(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +int do_ut_optee(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { struct unit_test *tests = ll_entry_start(struct unit_test, optee_test); diff --git a/test/overlay/cmd_ut_overlay.c b/test/overlay/cmd_ut_overlay.c index c8d41a4dca2..da050795964 100644 --- a/test/overlay/cmd_ut_overlay.c +++ b/test/overlay/cmd_ut_overlay.c @@ -210,7 +210,7 @@ static int fdt_overlay_stacked(struct unit_test_state *uts) } OVERLAY_TEST(fdt_overlay_stacked, 0); -int do_ut_overlay(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +int do_ut_overlay(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { struct unit_test *tests = ll_entry_start(struct unit_test, overlay_test); diff --git a/test/print_ut.c b/test/print_ut.c index a3b9974ad26..1cc2a7b8f14 100644 --- a/test/print_ut.c +++ b/test/print_ut.c @@ -7,6 +7,7 @@ #include <common.h> #if CONFIG_IS_ENABLED(EFI_LOADER) && !defined(API_BUILD) +#include <command.h> #include <efi_api.h> #endif #include <display_options.h> @@ -68,7 +69,7 @@ static void efi_ut_print(void) #endif } -static int do_ut_print(cmd_tbl_t *cmdtp, int flag, int argc, +static int do_ut_print(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { char big_str[400]; diff --git a/test/str_ut.c b/test/str_ut.c index 7c8015050ad..ef1205dbbd0 100644 --- a/test/str_ut.c +++ b/test/str_ut.c @@ -105,7 +105,7 @@ static int str_simple_strtoul(struct unit_test_state *uts) } STR_TEST(str_simple_strtoul, 0); -int do_ut_str(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) +int do_ut_str(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { struct unit_test *tests = ll_entry_start(struct unit_test, str_test); diff --git a/test/time_ut.c b/test/time_ut.c index 40a19a50d93..70a866b441e 100644 --- a/test/time_ut.c +++ b/test/time_ut.c @@ -117,7 +117,7 @@ static int test_udelay(void) return 0; } -int do_ut_time(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +int do_ut_time(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { int ret = 0; diff --git a/test/unicode_ut.c b/test/unicode_ut.c index d8b4aa9b443..7265464c327 100644 --- a/test/unicode_ut.c +++ b/test/unicode_ut.c @@ -591,7 +591,7 @@ static int unicode_test_u16_strsize(struct unit_test_state *uts) } UNICODE_TEST(unicode_test_u16_strsize); -int do_ut_unicode(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +int do_ut_unicode(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { struct unit_test *tests = ll_entry_start(struct unit_test, unicode_test); const int n_ents = ll_entry_count(struct unit_test, unicode_test); |