From 09140113108541b95d340f3c7b6ee597d31ccc73 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 10 May 2020 11:40:03 -0600 Subject: 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 --- cmd/pxe_utils.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'cmd/pxe_utils.c') diff --git a/cmd/pxe_utils.c b/cmd/pxe_utils.c index 8fc33670c8..ba4bb6347e 100644 --- a/cmd/pxe_utils.c +++ b/cmd/pxe_utils.c @@ -5,6 +5,7 @@ */ #include +#include #include #include #include @@ -100,7 +101,8 @@ static int get_bootfile_path(const char *file_path, char *bootfile_path, return 1; } -int (*do_getfile)(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr); +int (*do_getfile)(struct cmd_tbl *cmdtp, const char *file_path, + char *file_addr); /* * As in pxelinux, paths to files referenced from files we retrieve are @@ -110,7 +112,7 @@ int (*do_getfile)(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr); * * Returns 1 for success, or < 0 on error. */ -static int get_relfile(cmd_tbl_t *cmdtp, const char *file_path, +static int get_relfile(struct cmd_tbl *cmdtp, const char *file_path, unsigned long file_addr) { size_t path_len; @@ -148,7 +150,7 @@ static int get_relfile(cmd_tbl_t *cmdtp, const char *file_path, * * Returns 1 on success, or < 0 for error. */ -int get_pxe_file(cmd_tbl_t *cmdtp, const char *file_path, +int get_pxe_file(struct cmd_tbl *cmdtp, const char *file_path, unsigned long file_addr) { unsigned long config_file_size; @@ -189,7 +191,7 @@ int get_pxe_file(cmd_tbl_t *cmdtp, const char *file_path, * * Returns 1 on success or < 0 on error. */ -int get_pxelinux_path(cmd_tbl_t *cmdtp, const char *file, +int get_pxelinux_path(struct cmd_tbl *cmdtp, const char *file, unsigned long pxefile_addr_r) { size_t base_len = strlen(PXELINUX_DIR); @@ -213,7 +215,7 @@ int get_pxelinux_path(cmd_tbl_t *cmdtp, const char *file, * * Returns 1 on success or < 0 on error. */ -static int get_relfile_envaddr(cmd_tbl_t *cmdtp, const char *file_path, +static int get_relfile_envaddr(struct cmd_tbl *cmdtp, const char *file_path, const char *envaddr_name) { unsigned long file_addr; @@ -343,7 +345,7 @@ static int label_localboot(struct pxe_label *label) * If the label specifies an 'append' line, its contents will overwrite that * of the 'bootargs' environment variable. */ -static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label) +static int label_boot(struct cmd_tbl *cmdtp, struct pxe_label *label) { char *bootm_argv[] = { "bootm", NULL, NULL, NULL, NULL }; char initrd_str[28]; @@ -822,7 +824,7 @@ static int parse_integer(char **c, int *dst) return 1; } -static int parse_pxefile_top(cmd_tbl_t *cmdtp, char *p, unsigned long base, +static int parse_pxefile_top(struct cmd_tbl *cmdtp, char *p, unsigned long base, struct pxe_menu *cfg, int nest_level); /* @@ -833,7 +835,7 @@ static int parse_pxefile_top(cmd_tbl_t *cmdtp, char *p, unsigned long base, * include, nest_level has already been incremented and doesn't need to be * incremented here. */ -static int handle_include(cmd_tbl_t *cmdtp, char **c, unsigned long base, +static int handle_include(struct cmd_tbl *cmdtp, char **c, unsigned long base, struct pxe_menu *cfg, int nest_level) { char *include_path; @@ -873,7 +875,7 @@ static int handle_include(cmd_tbl_t *cmdtp, char **c, unsigned long base, * nest_level should be 1 when parsing the top level pxe file, 2 when parsing * a file it includes, 3 when parsing a file included by that file, and so on. */ -static int parse_menu(cmd_tbl_t *cmdtp, char **c, struct pxe_menu *cfg, +static int parse_menu(struct cmd_tbl *cmdtp, char **c, struct pxe_menu *cfg, unsigned long base, int nest_level) { struct token t; @@ -1086,7 +1088,7 @@ static int parse_label(char **c, struct pxe_menu *cfg) * * Returns 1 on success, < 0 on error. */ -static int parse_pxefile_top(cmd_tbl_t *cmdtp, char *p, unsigned long base, +static int parse_pxefile_top(struct cmd_tbl *cmdtp, char *p, unsigned long base, struct pxe_menu *cfg, int nest_level) { struct token t; @@ -1194,7 +1196,7 @@ void destroy_pxe_menu(struct pxe_menu *cfg) * files it includes). The resulting pxe_menu struct can be free()'d by using * the destroy_pxe_menu() function. */ -struct pxe_menu *parse_pxefile(cmd_tbl_t *cmdtp, unsigned long menucfg) +struct pxe_menu *parse_pxefile(struct cmd_tbl *cmdtp, unsigned long menucfg) { struct pxe_menu *cfg; char *buf; @@ -1278,7 +1280,7 @@ static struct menu *pxe_menu_to_menu(struct pxe_menu *cfg) /* * Try to boot any labels we have yet to attempt to boot. */ -static void boot_unattempted_labels(cmd_tbl_t *cmdtp, struct pxe_menu *cfg) +static void boot_unattempted_labels(struct cmd_tbl *cmdtp, struct pxe_menu *cfg) { struct list_head *pos; struct pxe_label *label; @@ -1303,7 +1305,7 @@ static void boot_unattempted_labels(cmd_tbl_t *cmdtp, struct pxe_menu *cfg) * If this function returns, there weren't any labels that successfully * booted, or the user interrupted the menu selection via ctrl+c. */ -void handle_pxe_menu(cmd_tbl_t *cmdtp, struct pxe_menu *cfg) +void handle_pxe_menu(struct cmd_tbl *cmdtp, struct pxe_menu *cfg) { void *choice; struct menu *m; -- cgit v1.2.3