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

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 <sjg@chromium.org>
This commit is contained in:
Simon Glass
2020-05-10 11:39:57 -06:00
committed by Tom Rini
parent 90526e9fba
commit 0528979fa7
56 changed files with 135 additions and 127 deletions

View File

@@ -318,7 +318,7 @@ void part_print(struct blk_desc *dev_desc)
#endif /* CONFIG_HAVE_BLOCK_DEVICE */
int part_get_info(struct blk_desc *dev_desc, int part,
disk_partition_t *info)
struct disk_partition *info)
{
#ifdef CONFIG_HAVE_BLOCK_DEVICE
struct part_driver *drv;
@@ -351,7 +351,8 @@ int part_get_info(struct blk_desc *dev_desc, int part,
return -1;
}
int part_get_info_whole_disk(struct blk_desc *dev_desc, disk_partition_t *info)
int part_get_info_whole_disk(struct blk_desc *dev_desc,
struct disk_partition *info)
{
info->start = 0;
info->size = dev_desc->lba;
@@ -431,7 +432,7 @@ cleanup:
#define PART_AUTO -1
int blk_get_device_part_str(const char *ifname, const char *dev_part_str,
struct blk_desc **dev_desc,
disk_partition_t *info, int allow_whole_dev)
struct disk_partition *info, int allow_whole_dev)
{
int ret = -1;
const char *part_str;
@@ -441,7 +442,7 @@ int blk_get_device_part_str(const char *ifname, const char *dev_part_str,
char *ep;
int p;
int part;
disk_partition_t tmpinfo;
struct disk_partition tmpinfo;
#ifdef CONFIG_SANDBOX
/*
@@ -646,7 +647,7 @@ cleanup:
}
int part_get_info_by_name_type(struct blk_desc *dev_desc, const char *name,
disk_partition_t *info, int part_type)
struct disk_partition *info, int part_type)
{
struct part_driver *part_drv;
int ret;
@@ -671,7 +672,7 @@ int part_get_info_by_name_type(struct blk_desc *dev_desc, const char *name,
}
int part_get_info_by_name(struct blk_desc *dev_desc, const char *name,
disk_partition_t *info)
struct disk_partition *info)
{
return part_get_info_by_name_type(dev_desc, name, info, PART_TYPE_ALL);
}
@@ -693,7 +694,7 @@ int part_get_info_by_name(struct blk_desc *dev_desc, const char *name,
static int part_get_info_by_dev_and_name(const char *dev_iface,
const char *dev_part_str,
struct blk_desc **dev_desc,
disk_partition_t *part_info)
struct disk_partition *part_info)
{
char *ep;
const char *part_str;
@@ -725,7 +726,7 @@ static int part_get_info_by_dev_and_name(const char *dev_iface,
int part_get_info_by_dev_and_name_or_num(const char *dev_iface,
const char *dev_part_str,
struct blk_desc **dev_desc,
disk_partition_t *part_info)
struct disk_partition *part_info)
{
/* Split the part_name if passed as "$dev_num#part_name". */
if (!part_get_info_by_dev_and_name(dev_iface, dev_part_str,

View File

@@ -291,7 +291,7 @@ static struct partition_block *find_partition(struct blk_desc *dev_desc,
* Get info about a partition
*/
static int part_get_info_amiga(struct blk_desc *dev_desc, int part,
disk_partition_t *info)
struct disk_partition *info)
{
struct partition_block *p = find_partition(dev_desc, part-1);
struct amiga_part_geometry *g;

View File

@@ -213,7 +213,7 @@ static void print_partition_extended(struct blk_desc *dev_desc,
static int part_get_info_extended(struct blk_desc *dev_desc,
lbaint_t ext_part_sector, lbaint_t relative,
int part_num, int which_part,
disk_partition_t *info, unsigned int disksig)
struct disk_partition *info, uint disksig)
{
ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
dos_partition_t *pt;
@@ -317,7 +317,7 @@ void part_print_dos(struct blk_desc *dev_desc)
}
int part_get_info_dos(struct blk_desc *dev_desc, int part,
disk_partition_t *info)
struct disk_partition *info)
{
return part_get_info_extended(dev_desc, 0, 0, 1, part, info, 0);
}

View File

@@ -259,7 +259,7 @@ void part_print_efi(struct blk_desc *dev_desc)
}
int part_get_info_efi(struct blk_desc *dev_desc, int part,
disk_partition_t *info)
struct disk_partition *info)
{
ALLOC_CACHE_ALIGN_BUFFER_PAD(gpt_header, gpt_head, 1, dev_desc->blksz);
gpt_entry *gpt_pte = NULL;
@@ -413,7 +413,7 @@ int write_gpt_table(struct blk_desc *dev_desc,
int gpt_fill_pte(struct blk_desc *dev_desc,
gpt_header *gpt_h, gpt_entry *gpt_e,
disk_partition_t *partitions, int parts)
struct disk_partition *partitions, int parts)
{
lbaint_t offset = (lbaint_t)le64_to_cpu(gpt_h->first_usable_lba);
lbaint_t last_usable_lba = (lbaint_t)
@@ -603,7 +603,7 @@ int gpt_fill_header(struct blk_desc *dev_desc, gpt_header *gpt_h,
}
int gpt_restore(struct blk_desc *dev_desc, char *str_disk_guid,
disk_partition_t *partitions, int parts_count)
struct disk_partition *partitions, int parts_count)
{
gpt_header *gpt_h;
gpt_entry *gpt_e;
@@ -698,7 +698,7 @@ int gpt_verify_headers(struct blk_desc *dev_desc, gpt_header *gpt_head,
}
int gpt_verify_partitions(struct blk_desc *dev_desc,
disk_partition_t *partitions, int parts,
struct disk_partition *partitions, int parts,
gpt_header *gpt_head, gpt_entry **gpt_pte)
{
char efi_str[PARTNAME_SZ + 1];

View File

@@ -47,7 +47,7 @@ unsigned long iso_dread(struct blk_desc *block_dev, lbaint_t start,
/* only boot records will be listed as valid partitions */
int part_get_info_iso_verb(struct blk_desc *dev_desc, int part_num,
disk_partition_t *info, int verb)
struct disk_partition *info, int verb)
{
int i,offset,entry_num;
unsigned short *chksumbuf;
@@ -200,14 +200,14 @@ found:
}
static int part_get_info_iso(struct blk_desc *dev_desc, int part_num,
disk_partition_t *info)
struct disk_partition *info)
{
return part_get_info_iso_verb(dev_desc, part_num, info, 0);
}
static void part_print_iso(struct blk_desc *dev_desc)
{
disk_partition_t info;
struct disk_partition info;
int i;
if (part_get_info_iso_verb(dev_desc, 1, &info, 0) == -1) {
@@ -226,7 +226,7 @@ static void part_print_iso(struct blk_desc *dev_desc)
static int part_test_iso(struct blk_desc *dev_desc)
{
disk_partition_t info;
struct disk_partition info;
return part_get_info_iso_verb(dev_desc, 1, &info, 0);
}

View File

@@ -214,7 +214,7 @@ static int part_mac_read_pdb(struct blk_desc *dev_desc, int part,
}
static int part_get_info_mac(struct blk_desc *dev_desc, int part,
disk_partition_t *info)
struct disk_partition *info)
{
ALLOC_CACHE_ALIGN_BUFFER(mac_driver_desc_t, ddesc, 1);
ALLOC_CACHE_ALIGN_BUFFER(mac_partition_t, mpart, 1);