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 /common | |
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 'common')
-rw-r--r-- | common/board_r.c | 4 | ||||
-rw-r--r-- | common/bootm.c | 27 | ||||
-rw-r--r-- | common/bootm_os.c | 46 | ||||
-rw-r--r-- | common/cli.c | 4 | ||||
-rw-r--r-- | common/cli_hush.c | 4 | ||||
-rw-r--r-- | common/cli_readline.c | 1 | ||||
-rw-r--r-- | common/command.c | 75 | ||||
-rw-r--r-- | common/dfu.c | 1 | ||||
-rw-r--r-- | common/exports.c | 1 | ||||
-rw-r--r-- | common/flash.c | 8 | ||||
-rw-r--r-- | common/hash.c | 4 | ||||
-rw-r--r-- | common/image-fdt.c | 4 | ||||
-rw-r--r-- | common/image.c | 13 | ||||
-rw-r--r-- | common/kgdb.c | 2 | ||||
-rw-r--r-- | common/lcd_console.c | 5 |
15 files changed, 104 insertions, 95 deletions
diff --git a/common/board_r.c b/common/board_r.c index a79a273d8f..45fde19ab7 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -357,8 +357,8 @@ static int initr_announce(void) #ifdef CONFIG_NEEDS_MANUAL_RELOC static int initr_manual_reloc_cmdtable(void) { - fixup_cmdtable(ll_entry_start(cmd_tbl_t, cmd), - ll_entry_count(cmd_tbl_t, cmd)); + fixup_cmdtable(ll_entry_start(struct cmd_tbl, cmd), + ll_entry_count(struct cmd_tbl, cmd)); return 0; } #endif diff --git a/common/bootm.c b/common/bootm.c index 96cba01589..c3b3ee371c 100644 --- a/common/bootm.c +++ b/common/bootm.c @@ -42,8 +42,8 @@ DECLARE_GLOBAL_DATA_PTR; bootm_headers_t images; /* pointers to os/initrd/fdt images */ -static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc, - char * const argv[], bootm_headers_t *images, +static const void *boot_get_kernel(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[], bootm_headers_t *images, ulong *os_data, ulong *os_len); __weak void board_quiesce_devices(void) @@ -67,8 +67,8 @@ static void boot_start_lmb(bootm_headers_t *images) static inline void boot_start_lmb(bootm_headers_t *images) { } #endif -static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, - char * const argv[]) +static int bootm_start(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) { memset((void *)&images, 0, sizeof(images)); images.verify = env_get_yesno("verify"); @@ -81,8 +81,8 @@ static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, return 0; } -static int bootm_find_os(cmd_tbl_t *cmdtp, int flag, int argc, - char * const argv[]) +static int bootm_find_os(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) { const void *os_hdr; bool ep_found = false; @@ -238,7 +238,7 @@ static int bootm_find_os(cmd_tbl_t *cmdtp, int flag, int argc, * 0, if all existing images were loaded correctly * 1, if an image is found but corrupted, or invalid */ -int bootm_find_images(int flag, int argc, char * const argv[]) +int bootm_find_images(int flag, int argc, char *const argv[]) { int ret; @@ -285,8 +285,8 @@ int bootm_find_images(int flag, int argc, char * const argv[]) return 0; } -static int bootm_find_other(cmd_tbl_t *cmdtp, int flag, int argc, - char * const argv[]) +static int bootm_find_other(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) { if (((images.os.type == IH_TYPE_KERNEL) || (images.os.type == IH_TYPE_KERNEL_NOLOAD) || @@ -520,8 +520,9 @@ static void fixup_silent_linux(void) * then the intent is to boot an OS, so this function will not return * unless the image type is standalone. */ -int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[], - int states, bootm_headers_t *images, int boot_progress) +int do_bootm_states(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[], int states, bootm_headers_t *images, + int boot_progress) { boot_os_fn *boot_fn; ulong iflag = 0; @@ -704,8 +705,8 @@ static image_header_t *image_get_kernel(ulong img_addr, int verify) * pointer to image header if valid image was found, plus kernel start * address and length, otherwise NULL */ -static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc, - char * const argv[], bootm_headers_t *images, +static const void *boot_get_kernel(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[], bootm_headers_t *images, ulong *os_data, ulong *os_len) { #if CONFIG_IS_ENABLED(LEGACY_IMAGE_FORMAT) diff --git a/common/bootm_os.c b/common/bootm_os.c index 8599bc8ca3..08675ffb61 100644 --- a/common/bootm_os.c +++ b/common/bootm_os.c @@ -21,7 +21,7 @@ DECLARE_GLOBAL_DATA_PTR; -static int do_bootm_standalone(int flag, int argc, char * const argv[], +static int do_bootm_standalone(int flag, int argc, char *const argv[], bootm_headers_t *images) { char *s; @@ -43,7 +43,7 @@ static int do_bootm_standalone(int flag, int argc, char * const argv[], /*******************************************************************/ #if defined(CONFIG_BOOTM_NETBSD) || defined(CONFIG_BOOTM_PLAN9) -static void copy_args(char *dest, int argc, char * const argv[], char delim) +static void copy_args(char *dest, int argc, char *const argv[], char delim) { int i; @@ -57,8 +57,8 @@ static void copy_args(char *dest, int argc, char * const argv[], char delim) #endif #ifdef CONFIG_BOOTM_NETBSD -static int do_bootm_netbsd(int flag, int argc, char * const argv[], - bootm_headers_t *images) +static int do_bootm_netbsd(int flag, int argc, char *const argv[], + bootm_headers_t *images) { void (*loader)(bd_t *, image_header_t *, char *, char *); image_header_t *os_hdr, *hdr; @@ -129,8 +129,8 @@ static int do_bootm_netbsd(int flag, int argc, char * const argv[], #endif /* CONFIG_BOOTM_NETBSD*/ #ifdef CONFIG_LYNXKDI -static int do_bootm_lynxkdi(int flag, int argc, char * const argv[], - bootm_headers_t *images) +static int do_bootm_lynxkdi(int flag, int argc, char *const argv[], + bootm_headers_t *images) { image_header_t *hdr = &images->legacy_hdr_os_copy; @@ -151,8 +151,8 @@ static int do_bootm_lynxkdi(int flag, int argc, char * const argv[], #endif /* CONFIG_LYNXKDI */ #ifdef CONFIG_BOOTM_RTEMS -static int do_bootm_rtems(int flag, int argc, char * const argv[], - bootm_headers_t *images) +static int do_bootm_rtems(int flag, int argc, char *const argv[], + bootm_headers_t *images) { void (*entry_point)(bd_t *); @@ -184,8 +184,8 @@ static int do_bootm_rtems(int flag, int argc, char * const argv[], #endif /* CONFIG_BOOTM_RTEMS */ #if defined(CONFIG_BOOTM_OSE) -static int do_bootm_ose(int flag, int argc, char * const argv[], - bootm_headers_t *images) +static int do_bootm_ose(int flag, int argc, char *const argv[], + bootm_headers_t *images) { void (*entry_point)(void); @@ -217,8 +217,8 @@ static int do_bootm_ose(int flag, int argc, char * const argv[], #endif /* CONFIG_BOOTM_OSE */ #if defined(CONFIG_BOOTM_PLAN9) -static int do_bootm_plan9(int flag, int argc, char * const argv[], - bootm_headers_t *images) +static int do_bootm_plan9(int flag, int argc, char *const argv[], + bootm_headers_t *images) { void (*entry_point)(void); char *s; @@ -324,7 +324,7 @@ static void do_bootvx_fdt(bootm_headers_t *images) puts("## vxWorks terminated\n"); } -static int do_bootm_vxworks_legacy(int flag, int argc, char * const argv[], +static int do_bootm_vxworks_legacy(int flag, int argc, char *const argv[], bootm_headers_t *images) { if (flag != BOOTM_STATE_OS_GO) @@ -342,7 +342,7 @@ static int do_bootm_vxworks_legacy(int flag, int argc, char * const argv[], return 1; } -int do_bootm_vxworks(int flag, int argc, char * const argv[], +int do_bootm_vxworks(int flag, int argc, char *const argv[], bootm_headers_t *images) { char *bootargs; @@ -379,8 +379,8 @@ int do_bootm_vxworks(int flag, int argc, char * const argv[], #endif #if defined(CONFIG_CMD_ELF) -static int do_bootm_qnxelf(int flag, int argc, char * const argv[], - bootm_headers_t *images) +static int do_bootm_qnxelf(int flag, int argc, char *const argv[], + bootm_headers_t *images) { char *local_args[2]; char str[16]; @@ -417,8 +417,8 @@ static int do_bootm_qnxelf(int flag, int argc, char * const argv[], #endif #ifdef CONFIG_INTEGRITY -static int do_bootm_integrity(int flag, int argc, char * const argv[], - bootm_headers_t *images) +static int do_bootm_integrity(int flag, int argc, char *const argv[], + bootm_headers_t *images) { void (*entry_point)(void); @@ -450,8 +450,8 @@ static int do_bootm_integrity(int flag, int argc, char * const argv[], #endif #ifdef CONFIG_BOOTM_OPENRTOS -static int do_bootm_openrtos(int flag, int argc, char * const argv[], - bootm_headers_t *images) +static int do_bootm_openrtos(int flag, int argc, char *const argv[], + bootm_headers_t *images) { void (*entry_point)(void); @@ -476,7 +476,7 @@ static int do_bootm_openrtos(int flag, int argc, char * const argv[], #endif #ifdef CONFIG_BOOTM_OPTEE -static int do_bootm_tee(int flag, int argc, char * const argv[], +static int do_bootm_tee(int flag, int argc, char *const argv[], bootm_headers_t *images) { int ret; @@ -504,7 +504,7 @@ static int do_bootm_tee(int flag, int argc, char * const argv[], #endif #ifdef CONFIG_BOOTM_EFI -static int do_bootm_efi(int flag, int argc, char * const argv[], +static int do_bootm_efi(int flag, int argc, char *const argv[], bootm_headers_t *images) { int ret; @@ -607,7 +607,7 @@ __weak void board_preboot_os(void) /* please define board specific board_preboot_os() */ } -int boot_selected_os(int argc, char * const argv[], int state, +int boot_selected_os(int argc, char *const argv[], int state, bootm_headers_t *images, boot_os_fn *boot_fn) { arch_preboot_os(); diff --git a/common/cli.c b/common/cli.c index e5e5894b2f..6635ab2bcf 100644 --- a/common/cli.c +++ b/common/cli.c @@ -129,7 +129,7 @@ int run_command_list(const char *cmd, int len, int flag) /****************************************************************************/ #if defined(CONFIG_CMD_RUN) -int do_run(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +int do_run(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { int i; @@ -183,7 +183,7 @@ bool cli_process_fdt(const char **cmdp) void cli_secure_boot_cmd(const char *cmd) { #ifdef CONFIG_CMDLINE - cmd_tbl_t *cmdtp; + struct cmd_tbl *cmdtp; #endif int rc; diff --git a/common/cli_hush.c b/common/cli_hush.c index a62af07cc5..5b1f119074 100644 --- a/common/cli_hush.c +++ b/common/cli_hush.c @@ -3664,8 +3664,8 @@ static char *make_string(char **inp, int *nonnull) } #ifdef __U_BOOT__ -static int do_showvar(cmd_tbl_t *cmdtp, int flag, int argc, - char * const argv[]) +static int do_showvar(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) { int i, k; int rcode = 0; diff --git a/common/cli_readline.c b/common/cli_readline.c index 6ef7a3e564..1f1e28c6d8 100644 --- a/common/cli_readline.c +++ b/common/cli_readline.c @@ -11,6 +11,7 @@ #include <common.h> #include <bootretry.h> #include <cli.h> +#include <command.h> #include <time.h> #include <watchdog.h> diff --git a/common/command.c b/common/command.c index 0d8bf244be..d75908aae2 100644 --- a/common/command.c +++ b/common/command.c @@ -19,14 +19,14 @@ * for long help messages */ -int _do_help(cmd_tbl_t *cmd_start, int cmd_items, cmd_tbl_t *cmdtp, int flag, - int argc, char * const argv[]) +int _do_help(struct cmd_tbl *cmd_start, int cmd_items, struct cmd_tbl *cmdtp, + int flag, int argc, char *const argv[]) { int i; int rcode = 0; if (argc == 1) { /* show list of commands */ - cmd_tbl_t *cmd_array[cmd_items]; + struct cmd_tbl *cmd_array[cmd_items]; int i, j, swaps; /* Make array of commands from .uboot_cmd section */ @@ -41,7 +41,7 @@ int _do_help(cmd_tbl_t *cmd_start, int cmd_items, cmd_tbl_t *cmdtp, int flag, for (j = 0; j < i; ++j) { if (strcmp(cmd_array[j]->name, cmd_array[j + 1]->name) > 0) { - cmd_tbl_t *tmp; + struct cmd_tbl *tmp; tmp = cmd_array[j]; cmd_array[j] = cmd_array[j + 1]; cmd_array[j + 1] = tmp; @@ -83,11 +83,12 @@ int _do_help(cmd_tbl_t *cmd_start, int cmd_items, cmd_tbl_t *cmdtp, int flag, } /* find command table entry for a command */ -cmd_tbl_t *find_cmd_tbl(const char *cmd, cmd_tbl_t *table, int table_len) +struct cmd_tbl *find_cmd_tbl(const char *cmd, struct cmd_tbl *table, + int table_len) { #ifdef CONFIG_CMDLINE - cmd_tbl_t *cmdtp; - cmd_tbl_t *cmdtp_temp = table; /* Init value */ + struct cmd_tbl *cmdtp; + struct cmd_tbl *cmdtp_temp = table; /* Init value */ const char *p; int len; int n_found = 0; @@ -117,14 +118,14 @@ cmd_tbl_t *find_cmd_tbl(const char *cmd, cmd_tbl_t *table, int table_len) return NULL; /* not found or ambiguous command */ } -cmd_tbl_t *find_cmd(const char *cmd) +struct cmd_tbl *find_cmd(const char *cmd) { - cmd_tbl_t *start = ll_entry_start(cmd_tbl_t, cmd); - const int len = ll_entry_count(cmd_tbl_t, cmd); + struct cmd_tbl *start = ll_entry_start(struct cmd_tbl, cmd); + const int len = ll_entry_count(struct cmd_tbl, cmd); return find_cmd_tbl(cmd, start, len); } -int cmd_usage(const cmd_tbl_t *cmdtp) +int cmd_usage(const struct cmd_tbl *cmdtp) { printf("%s - %s\n\n", cmdtp->name, cmdtp->usage); @@ -145,7 +146,8 @@ int cmd_usage(const cmd_tbl_t *cmdtp) #ifdef CONFIG_AUTO_COMPLETE static char env_complete_buf[512]; -int var_complete(int argc, char * const argv[], char last_char, int maxv, char *cmdv[]) +int var_complete(int argc, char *const argv[], char last_char, int maxv, + char *cmdv[]) { int space; @@ -163,7 +165,7 @@ int var_complete(int argc, char * const argv[], char last_char, int maxv, char * return 0; } -static int dollar_complete(int argc, char * const argv[], char last_char, +static int dollar_complete(int argc, char *const argv[], char last_char, int maxv, char *cmdv[]) { /* Make sure the last argument starts with a $. */ @@ -177,12 +179,12 @@ static int dollar_complete(int argc, char * const argv[], char last_char, /*************************************************************************************/ -int complete_subcmdv(cmd_tbl_t *cmdtp, int count, int argc, - char * const argv[], char last_char, +int complete_subcmdv(struct cmd_tbl *cmdtp, int count, int argc, + char *const argv[], char last_char, int maxv, char *cmdv[]) { #ifdef CONFIG_CMDLINE - const cmd_tbl_t *cmdend = cmdtp + count; + const struct cmd_tbl *cmdend = cmdtp + count; const char *p; int len, clen; int n_found = 0; @@ -254,12 +256,12 @@ int complete_subcmdv(cmd_tbl_t *cmdtp, int count, int argc, #endif } -static int complete_cmdv(int argc, char * const argv[], char last_char, +static int complete_cmdv(int argc, char *const argv[], char last_char, int maxv, char *cmdv[]) { #ifdef CONFIG_CMDLINE - return complete_subcmdv(ll_entry_start(cmd_tbl_t, cmd), - ll_entry_count(cmd_tbl_t, cmd), argc, argv, + return complete_subcmdv(ll_entry_start(struct cmd_tbl, cmd), + ll_entry_count(struct cmd_tbl, cmd), argc, argv, last_char, maxv, cmdv); #else return 0; @@ -296,7 +298,8 @@ static int make_argv(char *s, int argvsz, char *argv[]) return argc; } -static void print_argv(const char *banner, const char *leader, const char *sep, int linemax, char * const argv[]) +static void print_argv(const char *banner, const char *leader, const char *sep, + int linemax, char *const argv[]) { int ll = leader != NULL ? strlen(leader) : 0; int sl = sep != NULL ? strlen(sep) : 0; @@ -323,7 +326,7 @@ static void print_argv(const char *banner, const char *leader, const char *sep, printf("\n"); } -static int find_common_prefix(char * const argv[]) +static int find_common_prefix(char *const argv[]) { int i, len; char *anchor, *s, *t; @@ -486,7 +489,7 @@ int cmd_get_data_size(char* arg, int default_size) #if defined(CONFIG_NEEDS_MANUAL_RELOC) DECLARE_GLOBAL_DATA_PTR; -void fixup_cmdtable(cmd_tbl_t *cmdtp, int size) +void fixup_cmdtable(struct cmd_tbl *cmdtp, int size) { int i; @@ -498,7 +501,7 @@ void fixup_cmdtable(cmd_tbl_t *cmdtp, int size) addr = (ulong)(cmdtp->cmd_rep) + gd->reloc_off; cmdtp->cmd_rep = - (int (*)(struct cmd_tbl_s *, int, int, + (int (*)(struct cmd_tbl *, int, int, char * const [], int *))addr; addr = (ulong)(cmdtp->cmd) + gd->reloc_off; @@ -506,8 +509,8 @@ void fixup_cmdtable(cmd_tbl_t *cmdtp, int size) printf("Command \"%s\": 0x%08lx => 0x%08lx\n", cmdtp->name, (ulong)(cmdtp->cmd), addr); #endif - cmdtp->cmd = - (int (*)(struct cmd_tbl_s *, int, int, char * const []))addr; + cmdtp->cmd = (int (*)(struct cmd_tbl *, int, int, + char *const []))addr; addr = (ulong)(cmdtp->name) + gd->reloc_off; cmdtp->name = (char *)addr; if (cmdtp->usage) { @@ -532,24 +535,24 @@ void fixup_cmdtable(cmd_tbl_t *cmdtp, int size) } #endif -int cmd_always_repeatable(cmd_tbl_t *cmdtp, int flag, int argc, - char * const argv[], int *repeatable) +int cmd_always_repeatable(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[], int *repeatable) { *repeatable = 1; return cmdtp->cmd(cmdtp, flag, argc, argv); } -int cmd_never_repeatable(cmd_tbl_t *cmdtp, int flag, int argc, - char * const argv[], int *repeatable) +int cmd_never_repeatable(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[], int *repeatable) { *repeatable = 0; return cmdtp->cmd(cmdtp, flag, argc, argv); } -int cmd_discard_repeatable(cmd_tbl_t *cmdtp, int flag, int argc, - char * const argv[]) +int cmd_discard_repeatable(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) { int repeatable; @@ -568,8 +571,8 @@ int cmd_discard_repeatable(cmd_tbl_t *cmdtp, int flag, int argc, * @param repeatable Can the command be repeated * @return 0 if command succeeded, else non-zero (CMD_RET_...) */ -static int cmd_call(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[], - int *repeatable) +static int cmd_call(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[], int *repeatable) { int result; @@ -579,11 +582,11 @@ static int cmd_call(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[], return result; } -enum command_ret_t cmd_process(int flag, int argc, char * const argv[], +enum command_ret_t cmd_process(int flag, int argc, char *const argv[], int *repeatable, ulong *ticks) { enum command_ret_t rc = CMD_RET_SUCCESS; - cmd_tbl_t *cmdtp; + struct cmd_tbl *cmdtp; #if defined(CONFIG_SYS_XTRACE) char *xtrace; @@ -638,7 +641,7 @@ enum command_ret_t cmd_process(int flag, int argc, char * const argv[], return rc; } -int cmd_process_error(cmd_tbl_t *cmdtp, int err) +int cmd_process_error(struct cmd_tbl *cmdtp, int err) { if (err == CMD_RET_USAGE) return CMD_RET_USAGE; diff --git a/common/dfu.c b/common/dfu.c index da6289b218..cd60f9a1e2 100644 --- a/common/dfu.c +++ b/common/dfu.c @@ -11,6 +11,7 @@ */ #include <common.h> +#include <command.h> #include <watchdog.h> #include <dfu.h> #include <console.h> diff --git a/common/exports.c b/common/exports.c index 18af38a5f6..6253b55694 100644 --- a/common/exports.c +++ b/common/exports.c @@ -1,4 +1,5 @@ #include <common.h> +#include <command.h> #include <exports.h> #include <malloc.h> #include <spi.h> diff --git a/common/flash.c b/common/flash.c index 4a28ac5d34..cde648d4b8 100644 --- a/common/flash.c +++ b/common/flash.c @@ -39,10 +39,10 @@ flash_protect(int flag, ulong from, ulong to, flash_info_t *info) s_end = info->sector_count - 1; /* index of last sector */ b_end = info->start[0] + info->size - 1; /* bank end address */ - debug ("flash_protect %s: from 0x%08lX to 0x%08lX\n", - (flag & FLAG_PROTECT_SET) ? "ON" : - (flag & FLAG_PROTECT_CLEAR) ? "OFF" : "???", - from, to); + debug("%s %s: from 0x%08lX to 0x%08lX\n", __func__, + (flag & FLAG_PROTECT_SET) ? "ON" : + (flag & FLAG_PROTECT_CLEAR) ? "OFF" : "???", + from, to); /* There is nothing to do if we have no data about the flash * or the protect range and flash range don't overlap. diff --git a/common/hash.c b/common/hash.c index 810854ce0f..34f00890b4 100644 --- a/common/hash.c +++ b/common/hash.c @@ -444,8 +444,8 @@ static void hash_show(struct hash_algo *algo, ulong addr, ulong len, uint8_t *ou printf("%02x", output[i]); } -int hash_command(const char *algo_name, int flags, cmd_tbl_t *cmdtp, int flag, - int argc, char * const argv[]) +int hash_command(const char *algo_name, int flags, struct cmd_tbl *cmdtp, + int flag, int argc, char *const argv[]) { ulong addr, len; diff --git a/common/image-fdt.c b/common/image-fdt.c index 270732278e..1d2263de5d 100644 --- a/common/image-fdt.c +++ b/common/image-fdt.c @@ -264,8 +264,8 @@ error: * 1, if fdt image is found but corrupted * of_flat_tree and of_size are set to 0 if no fdt exists */ -int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch, - bootm_headers_t *images, char **of_flat_tree, ulong *of_size) +int boot_get_fdt(int flag, int argc, char *const argv[], uint8_t arch, + bootm_headers_t *images, char **of_flat_tree, ulong *of_size) { #if CONFIG_IS_ENABLED(LEGACY_IMAGE_FORMAT) const image_header_t *fdt_hdr; diff --git a/common/image.c b/common/image.c index 6a24abf6ff..9e4e23cac4 100644 --- a/common/image.c +++ b/common/image.c @@ -47,7 +47,8 @@ #include <lzma/LzmaTools.h> #ifdef CONFIG_CMD_BDI -extern int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); +extern int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]); #endif DECLARE_GLOBAL_DATA_PTR; @@ -1075,8 +1076,8 @@ int genimg_has_config(bootm_headers_t *images) * 1, if ramdisk image is found but corrupted, or invalid * rd_start and rd_end are set to 0 if no ramdisk exists */ -int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images, - uint8_t arch, ulong *rd_start, ulong *rd_end) +int boot_get_ramdisk(int argc, char *const argv[], bootm_headers_t *images, + uint8_t arch, ulong *rd_start, ulong *rd_end) { ulong rd_addr, rd_load; ulong rd_data, rd_len; @@ -1371,7 +1372,7 @@ int boot_get_setup(bootm_headers_t *images, uint8_t arch, #if IMAGE_ENABLE_FIT #if defined(CONFIG_FPGA) -int boot_get_fpga(int argc, char * const argv[], bootm_headers_t *images, +int boot_get_fpga(int argc, char *const argv[], bootm_headers_t *images, uint8_t arch, const ulong *ld_start, ulong * const ld_len) { ulong tmp_img_addr, img_data, img_len; @@ -1472,8 +1473,8 @@ static void fit_loadable_process(uint8_t img_type, fit_loadable_handler->handler(img_data, img_len); } -int boot_get_loadable(int argc, char * const argv[], bootm_headers_t *images, - uint8_t arch, const ulong *ld_start, ulong * const ld_len) +int boot_get_loadable(int argc, char *const argv[], bootm_headers_t *images, + uint8_t arch, const ulong *ld_start, ulong * const ld_len) { /* * These variables are used to hold the current image location diff --git a/common/kgdb.c b/common/kgdb.c index daf53bed7a..312e14960a 100644 --- a/common/kgdb.c +++ b/common/kgdb.c @@ -574,7 +574,7 @@ breakpoint(void) } int -do_kgdb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +do_kgdb(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { printf("Entering KGDB mode via exception handler...\n\n"); kgdb_breakpoint(argc - 1, argv + 1); diff --git a/common/lcd_console.c b/common/lcd_console.c index d34bc2fa83..ad5f307af4 100644 --- a/common/lcd_console.c +++ b/common/lcd_console.c @@ -7,6 +7,7 @@ */ #include <common.h> +#include <command.h> #include <lcd.h> #include <serial.h> #include <video_font.h> /* Get font data, width and height */ @@ -219,7 +220,7 @@ void lcd_printf(const char *fmt, ...) lcd_puts(buf); } -static int do_lcd_setcursor(cmd_tbl_t *cmdtp, int flag, int argc, +static int do_lcd_setcursor(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { unsigned int col, row; @@ -234,7 +235,7 @@ static int do_lcd_setcursor(cmd_tbl_t *cmdtp, int flag, int argc, return 0; } -static int do_lcd_puts(cmd_tbl_t *cmdtp, int flag, int argc, +static int do_lcd_puts(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { if (argc != 2) |