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/ab_select.c | 2 +- cmd/bcb.c | 4 ++-- cmd/disk.c | 2 +- cmd/fat.c | 4 ++-- cmd/gpt.c | 17 +++++++++-------- cmd/part.c | 6 +++--- cmd/read.c | 2 +- cmd/reiser.c | 4 ++-- cmd/usb_mass_storage.c | 2 +- cmd/zfs.c | 4 ++-- 10 files changed, 24 insertions(+), 23 deletions(-) (limited to 'cmd') diff --git a/cmd/ab_select.c b/cmd/ab_select.c index 7c8f2ee..d0d957d 100644 --- a/cmd/ab_select.c +++ b/cmd/ab_select.c @@ -11,7 +11,7 @@ static int do_ab_select(cmd_tbl_t *cmdtp, int flag, int argc, { int ret; struct blk_desc *dev_desc; - disk_partition_t part_info; + struct disk_partition part_info; char slot[2]; if (argc != 4) diff --git a/cmd/bcb.c b/cmd/bcb.c index 9626f2c..62f9a44 100644 --- a/cmd/bcb.c +++ b/cmd/bcb.c @@ -112,7 +112,7 @@ static int do_bcb_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { struct blk_desc *desc; - disk_partition_t info; + struct disk_partition info; u64 cnt; char *endp; int part, ret; @@ -252,7 +252,7 @@ static int do_bcb_store(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { struct blk_desc *desc; - disk_partition_t info; + struct disk_partition info; u64 cnt; int ret; diff --git a/cmd/disk.c b/cmd/disk.c index 15973b7..9e008a3 100644 --- a/cmd/disk.c +++ b/cmd/disk.c @@ -16,7 +16,7 @@ int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc, int part; ulong addr = CONFIG_SYS_LOAD_ADDR; ulong cnt; - disk_partition_t info; + struct disk_partition info; #if defined(CONFIG_LEGACY_IMAGE_FORMAT) image_header_t *hdr; #endif diff --git a/cmd/fat.c b/cmd/fat.c index 28fca50..854fe27 100644 --- a/cmd/fat.c +++ b/cmd/fat.c @@ -64,7 +64,7 @@ static int do_fat_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc, { int dev, part; struct blk_desc *dev_desc; - disk_partition_t info; + struct disk_partition info; if (argc < 2) { printf("usage: fatinfo []\n"); @@ -101,7 +101,7 @@ static int do_fat_fswrite(cmd_tbl_t *cmdtp, int flag, unsigned long count; long offset; struct blk_desc *dev_desc = NULL; - disk_partition_t info; + struct disk_partition info; int dev = 0; int part = 1; void *buf; diff --git a/cmd/gpt.c b/cmd/gpt.c index 98c788e..f2b1ad5 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; diff --git a/cmd/part.c b/cmd/part.c index 5e4e45c..4b2e06e 100644 --- a/cmd/part.c +++ b/cmd/part.c @@ -32,7 +32,7 @@ static int do_part_uuid(int argc, char * const argv[]) { int part; struct blk_desc *dev_desc; - disk_partition_t info; + struct disk_partition info; if (argc < 2) return CMD_RET_USAGE; @@ -90,7 +90,7 @@ static int do_part_list(int argc, char * const argv[]) if (var != NULL) { int p; char str[512] = { '\0', }; - disk_partition_t info; + struct disk_partition info; for (p = 1; p < MAX_SEARCH_PARTITIONS; p++) { char t[5]; @@ -117,7 +117,7 @@ static int do_part_list(int argc, char * const argv[]) static int do_part_info(int argc, char * const argv[], enum cmd_part_info param) { struct blk_desc *desc; - disk_partition_t info; + struct disk_partition info; char buf[512] = { 0 }; char *endp; int part; diff --git a/cmd/read.c b/cmd/read.c index 82c2d9a..7977e9d 100644 --- a/cmd/read.c +++ b/cmd/read.c @@ -18,7 +18,7 @@ int do_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) struct blk_desc *dev_desc = NULL; int dev; int part = 0; - disk_partition_t part_info; + struct disk_partition part_info; ulong offset = 0u; ulong limit = 0u; void *addr; diff --git a/cmd/reiser.c b/cmd/reiser.c index 598fab4..28e8277 100644 --- a/cmd/reiser.c +++ b/cmd/reiser.c @@ -35,7 +35,7 @@ int do_reiserls (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) char *filename = "/"; int dev, part; struct blk_desc *dev_desc = NULL; - disk_partition_t info; + struct disk_partition info; if (argc < 3) return CMD_RET_USAGE; @@ -81,7 +81,7 @@ int do_reiserload (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) char *filename = NULL; int dev, part; ulong addr = 0, filelen; - disk_partition_t info; + struct disk_partition info; struct blk_desc *dev_desc = NULL; unsigned long count; char *addr_str; diff --git a/cmd/usb_mass_storage.c b/cmd/usb_mass_storage.c index c5c6899..52ff637 100644 --- a/cmd/usb_mass_storage.c +++ b/cmd/usb_mass_storage.c @@ -55,7 +55,7 @@ static int ums_init(const char *devtype, const char *devnums_part_str) { char *s, *t, *devnum_part_str, *name; struct blk_desc *block_dev; - disk_partition_t info; + struct disk_partition info; int partnum; int ret = -1; struct ums *ums_new; diff --git a/cmd/zfs.c b/cmd/zfs.c index 9c237a5..2b622a8 100644 --- a/cmd/zfs.c +++ b/cmd/zfs.c @@ -38,7 +38,7 @@ static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[] int dev; int part; ulong addr = 0; - disk_partition_t info; + struct disk_partition info; struct blk_desc *dev_desc; unsigned long count; const char *addr_str; @@ -135,7 +135,7 @@ static int do_zfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) const char *filename = "/"; int part; struct blk_desc *dev_desc; - disk_partition_t info; + struct disk_partition info; struct device_s vdev; if (argc < 2) -- cgit v1.1