1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 08:42:12 +02:00

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>
This commit is contained in:
Simon Glass
2020-05-10 11:40:03 -06:00
committed by Tom Rini
parent 691d719db7
commit 0914011310
465 changed files with 1987 additions and 1527 deletions

View File

@@ -6,6 +6,7 @@
#include <android_image.h>
#include <common.h>
#include <command.h>
#include <image.h>
#include <mapmem.h>
@@ -15,7 +16,7 @@
/* Please use abootimg_addr() macro to obtain the boot image address */
static ulong _abootimg_addr = -1;
static int abootimg_get_ver(int argc, char * const argv[])
static int abootimg_get_ver(int argc, char *const argv[])
{
const struct andr_img_hdr *hdr;
int res = CMD_RET_SUCCESS;
@@ -40,7 +41,7 @@ exit:
return res;
}
static int abootimg_get_recovery_dtbo(int argc, char * const argv[])
static int abootimg_get_recovery_dtbo(int argc, char *const argv[])
{
ulong addr;
u32 size;
@@ -62,7 +63,7 @@ static int abootimg_get_recovery_dtbo(int argc, char * const argv[])
return CMD_RET_SUCCESS;
}
static int abootimg_get_dtb_load_addr(int argc, char * const argv[])
static int abootimg_get_dtb_load_addr(int argc, char *const argv[])
{
const struct andr_img_hdr *hdr;
int res = CMD_RET_SUCCESS;
@@ -93,7 +94,7 @@ exit:
return res;
}
static int abootimg_get_dtb_by_index(int argc, char * const argv[])
static int abootimg_get_dtb_by_index(int argc, char *const argv[])
{
const char *index_str;
u32 num;
@@ -140,7 +141,7 @@ static int abootimg_get_dtb_by_index(int argc, char * const argv[])
return CMD_RET_SUCCESS;
}
static int abootimg_get_dtb(int argc, char * const argv[])
static int abootimg_get_dtb(int argc, char *const argv[])
{
if (argc < 1)
return CMD_RET_USAGE;
@@ -151,8 +152,8 @@ static int abootimg_get_dtb(int argc, char * const argv[])
return CMD_RET_USAGE;
}
static int do_abootimg_addr(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
static int do_abootimg_addr(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
char *endp;
ulong img_addr;
@@ -170,8 +171,8 @@ static int do_abootimg_addr(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_SUCCESS;
}
static int do_abootimg_get(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
static int do_abootimg_get(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
const char *param;
@@ -193,8 +194,8 @@ static int do_abootimg_get(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_USAGE;
}
static int do_abootimg_dump(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
static int do_abootimg_dump(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
if (argc != 2)
return CMD_RET_USAGE;
@@ -209,16 +210,16 @@ static int do_abootimg_dump(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_SUCCESS;
}
static cmd_tbl_t cmd_abootimg_sub[] = {
static struct cmd_tbl cmd_abootimg_sub[] = {
U_BOOT_CMD_MKENT(addr, 2, 1, do_abootimg_addr, "", ""),
U_BOOT_CMD_MKENT(dump, 2, 1, do_abootimg_dump, "", ""),
U_BOOT_CMD_MKENT(get, 5, 1, do_abootimg_get, "", ""),
};
static int do_abootimg(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
static int do_abootimg(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
cmd_tbl_t *cp;
struct cmd_tbl *cp;
cp = find_cmd_tbl(argv[1], cmd_abootimg_sub,
ARRAY_SIZE(cmd_abootimg_sub));