From ba06b3c50b4b275b66822dac8a894cd5ec508944 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 10 May 2020 11:39:52 -0600 Subject: common: Drop uuid.h from common header Move this uncommon header out of the common header. Signed-off-by: Simon Glass --- cmd/gpt.c | 1 + 1 file changed, 1 insertion(+) (limited to 'cmd/gpt.c') diff --git a/cmd/gpt.c b/cmd/gpt.c index b8d11c167df..98c788e7579 100644 --- a/cmd/gpt.c +++ b/cmd/gpt.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include -- cgit v1.2.3 From 0528979fa7ab7853faaf2ecf34b7721dd4c0b383 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 10 May 2020 11:39:57 -0600 Subject: part: Drop disk_partition_t typedef We should not be using typedefs and these make it harder to use forward declarations (to reduce header file inclusions). Drop the typedef. Signed-off-by: Simon Glass --- cmd/gpt.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'cmd/gpt.c') diff --git a/cmd/gpt.c b/cmd/gpt.c index 98c788e7579..f2b1ad5489b 100644 --- a/cmd/gpt.c +++ b/cmd/gpt.c @@ -189,7 +189,8 @@ static void del_gpt_info(void) } } -static struct disk_part *allocate_disk_part(disk_partition_t *info, int partnum) +static struct disk_part *allocate_disk_part(struct disk_partition *info, + int partnum) { struct disk_part *newpart; newpart = calloc(1, sizeof(struct disk_part)); @@ -310,7 +311,7 @@ static int get_gpt_info(struct blk_desc *dev_desc) { /* start partition numbering at 1, as U-Boot does */ int valid_parts = 0, p, ret; - disk_partition_t info; + struct disk_partition info; struct disk_part *new_disk_part; /* @@ -375,14 +376,14 @@ static int do_get_gpt_info(struct blk_desc *dev_desc) static int set_gpt_info(struct blk_desc *dev_desc, const char *str_part, char **str_disk_guid, - disk_partition_t **partitions, + struct disk_partition **partitions, u8 *parts_count) { char *tok, *str, *s; int i; char *val, *p; int p_count; - disk_partition_t *parts; + struct disk_partition *parts; int errno = 0; uint64_t size_ll, start_ll; lbaint_t offset = 0; @@ -440,7 +441,7 @@ static int set_gpt_info(struct blk_desc *dev_desc, } /* allocate memory for partitions */ - parts = calloc(sizeof(disk_partition_t), p_count); + parts = calloc(sizeof(struct disk_partition), p_count); if (parts == NULL) return -ENOMEM; @@ -557,7 +558,7 @@ static int gpt_default(struct blk_desc *blk_dev_desc, const char *str_part) int ret; char *str_disk_guid; u8 part_count = 0; - disk_partition_t *partitions = NULL; + struct disk_partition *partitions = NULL; /* fill partitions */ ret = set_gpt_info(blk_dev_desc, str_part, @@ -584,7 +585,7 @@ static int gpt_verify(struct blk_desc *blk_dev_desc, const char *str_part) { ALLOC_CACHE_ALIGN_BUFFER_PAD(gpt_header, gpt_head, 1, blk_dev_desc->blksz); - disk_partition_t *partitions = NULL; + struct disk_partition *partitions = NULL; gpt_entry *gpt_pte = NULL; char *str_disk_guid; u8 part_count = 0; @@ -640,7 +641,7 @@ static int do_rename_gpt_parts(struct blk_desc *dev_desc, char *subcomm, { struct list_head *pos; struct disk_part *curr; - disk_partition_t *new_partitions = NULL; + struct disk_partition *new_partitions = NULL; char disk_guid[UUID_STR_LEN + 1]; char *partitions_list, *str_disk_guid = NULL; u8 part_count = 0; -- cgit v1.2.3 From e6f6f9e64882ddf242437c73fdd9ff06a8eb7c21 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 10 May 2020 11:39:58 -0600 Subject: common: Drop part.h from common header Move this uncommon header out of the common header. Signed-off-by: Simon Glass --- cmd/gpt.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cmd/gpt.c') diff --git a/cmd/gpt.c b/cmd/gpt.c index f2b1ad5489b..c2964d85086 100644 --- a/cmd/gpt.c +++ b/cmd/gpt.c @@ -11,9 +11,11 @@ */ #include +#include #include #include #include +#include #include #include #include -- cgit v1.2.3 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/gpt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/gpt.c') diff --git a/cmd/gpt.c b/cmd/gpt.c index c2964d85086..05f5f943a8e 100644 --- a/cmd/gpt.c +++ b/cmd/gpt.c @@ -794,7 +794,7 @@ static int do_rename_gpt_parts(struct blk_desc *dev_desc, char *subcomm, * * @return zero on success; otherwise error */ -static int do_gpt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +static int do_gpt(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { int ret = CMD_RET_SUCCESS; int dev = 0; -- cgit v1.2.3 From f7ae49fc4f363a803dab3be078e93ead8e75a8e9 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 10 May 2020 11:40:05 -0600 Subject: common: Drop log.h from common header Move this header out of the common header. Signed-off-by: Simon Glass --- cmd/gpt.c | 1 + 1 file changed, 1 insertion(+) (limited to 'cmd/gpt.c') diff --git a/cmd/gpt.c b/cmd/gpt.c index 05f5f943a8e..df759416c88 100644 --- a/cmd/gpt.c +++ b/cmd/gpt.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include -- cgit v1.2.3