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/net.c | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) (limited to 'cmd/net.c') diff --git a/cmd/net.c b/cmd/net.c index 282b38ccf9..25390b0474 100644 --- a/cmd/net.c +++ b/cmd/net.c @@ -14,10 +14,11 @@ #include #include -static int netboot_common(enum proto_t, cmd_tbl_t *, int, char * const []); +static int netboot_common(enum proto_t, struct cmd_tbl *, int, char * const []); #ifdef CONFIG_CMD_BOOTP -static int do_bootp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +static int do_bootp(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) { return netboot_common(BOOTP, cmdtp, argc, argv); } @@ -30,7 +31,7 @@ U_BOOT_CMD( #endif #ifdef CONFIG_CMD_TFTPBOOT -int do_tftpb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +int do_tftpb(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { int ret; @@ -48,7 +49,8 @@ U_BOOT_CMD( #endif #ifdef CONFIG_CMD_TFTPPUT -static int do_tftpput(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +static int do_tftpput(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) { return netboot_common(TFTPPUT, cmdtp, argc, argv); } @@ -61,7 +63,8 @@ U_BOOT_CMD( #endif #ifdef CONFIG_CMD_TFTPSRV -static int do_tftpsrv(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) +static int do_tftpsrv(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) { return netboot_common(TFTPSRV, cmdtp, argc, argv); } @@ -78,7 +81,7 @@ U_BOOT_CMD( #ifdef CONFIG_CMD_RARP -int do_rarpb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +int do_rarpb(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { return netboot_common(RARP, cmdtp, argc, argv); } @@ -91,7 +94,8 @@ U_BOOT_CMD( #endif #if defined(CONFIG_CMD_DHCP) -static int do_dhcp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +static int do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) { return netboot_common(DHCP, cmdtp, argc, argv); } @@ -104,7 +108,8 @@ U_BOOT_CMD( #endif #if defined(CONFIG_CMD_NFS) -static int do_nfs(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +static int do_nfs(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) { return netboot_common(NFS, cmdtp, argc, argv); } @@ -177,8 +182,8 @@ static void netboot_update_env(void) #endif } -static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, - char * const argv[]) +static int netboot_common(enum proto_t proto, struct cmd_tbl *cmdtp, int argc, + char *const argv[]) { char *s; char *end; @@ -273,7 +278,8 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, } #if defined(CONFIG_CMD_PING) -static int do_ping(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +static int do_ping(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) { if (argc < 2) return CMD_RET_USAGE; @@ -321,7 +327,7 @@ static void cdp_update_env(void) } } -int do_cdp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +int do_cdp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { int r; @@ -344,7 +350,7 @@ U_BOOT_CMD( #endif #if defined(CONFIG_CMD_SNTP) -int do_sntp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +int do_sntp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { char *toff; @@ -385,7 +391,7 @@ U_BOOT_CMD( #endif #if defined(CONFIG_CMD_DNS) -int do_dns(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +int do_dns(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { if (argc == 1) return CMD_RET_USAGE; @@ -431,8 +437,8 @@ U_BOOT_CMD( #endif /* CONFIG_CMD_DNS */ #if defined(CONFIG_CMD_LINK_LOCAL) -static int do_link_local(cmd_tbl_t *cmdtp, int flag, int argc, - char * const argv[]) +static int do_link_local(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) { char tmp[22]; -- cgit v1.2.3