@@ -90,7 +90,7 @@ static u32 omap_mmc_get_part_size(const char *part)
{
int res;
struct blk_desc *dev_desc;
- disk_partition_t info;
+ struct disk_partition info;
u64 sz = 0;
dev_desc = blk_get_dev("mmc", CONFIG_FASTBOOT_FLASH_MMC_DEV);
@@ -6,6 +6,7 @@
#include <common.h>
#include <cpu_func.h>
#include <mmc.h>
+#include <asm/cache.h>
#include <asm/io.h>
#include <asm/ioapic.h>
#include <asm/irq.h>
@@ -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)
@@ -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;
@@ -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
@@ -70,7 +70,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 <interface> [<dev[:part]>]\n");
@@ -107,7 +107,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;
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -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)
@@ -81,7 +81,7 @@ static int ab_control_default(struct bootloader_control *abc)
* @return 0 on success and a negative on error
*/
static int ab_control_create_from_disk(struct blk_desc *dev_desc,
- const disk_partition_t *part_info,
+ const struct disk_partition *part_info,
struct bootloader_control **abc)
{
ulong abc_offset, abc_blocks, ret;
@@ -131,7 +131,7 @@ static int ab_control_create_from_disk(struct blk_desc *dev_desc,
* @return 0 on success and a negative on error
*/
static int ab_control_store(struct blk_desc *dev_desc,
- const disk_partition_t *part_info,
+ const struct disk_partition *part_info,
struct bootloader_control *abc)
{
ulong abc_offset, abc_blocks, ret;
@@ -178,7 +178,7 @@ static int ab_compare_slots(const struct slot_metadata *a,
return 0;
}
-int ab_select_slot(struct blk_desc *dev_desc, disk_partition_t *part_info)
+int ab_select_slot(struct blk_desc *dev_desc, struct disk_partition *part_info)
{
struct bootloader_control *abc = NULL;
u32 crc32_le;
@@ -15,7 +15,7 @@ int spl_load_image_ext(struct spl_image_info *spl_image,
s32 err;
struct image_header *header;
loff_t filelen, actlen;
- disk_partition_t part_info = {};
+ struct disk_partition part_info = {};
header = spl_get_load_buffer(-sizeof(*header), sizeof(*header));
@@ -69,7 +69,7 @@ int spl_load_image_ext_os(struct spl_image_info *spl_image,
{
int err;
__maybe_unused loff_t filelen, actlen;
- disk_partition_t part_info = {};
+ struct disk_partition part_info = {};
__maybe_unused char *file;
if (part_get_info(block_dev, partition, &part_info)) {
@@ -168,7 +168,7 @@ static int mmc_load_image_raw_partition(struct spl_image_info *spl_image,
struct mmc *mmc, int partition,
unsigned long sector)
{
- disk_partition_t info;
+ struct disk_partition info;
int err;
#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE
@@ -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,
@@ -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;
@@ -207,7 +207,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;
@@ -311,7 +311,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);
}
@@ -255,7 +255,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;
@@ -409,7 +409,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)
@@ -599,7 +599,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;
@@ -694,7 +694,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];
@@ -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);
}
@@ -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);
@@ -369,7 +369,7 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s)
simple_strtoul(s, NULL, 0);
} else if (!strcmp(entity_type, "part")) {
- disk_partition_t partinfo;
+ struct disk_partition partinfo;
struct blk_desc *blk_dev = mmc_get_blk_desc(mmc);
int mmcdev = second_arg;
int mmcpart = third_arg;
@@ -103,7 +103,7 @@ static int getvar_get_part_info(const char *part_name, char *response,
int r;
# if CONFIG_IS_ENABLED(FASTBOOT_FLASH_MMC)
struct blk_desc *dev_desc;
- disk_partition_t part_info;
+ struct disk_partition part_info;
r = fastboot_mmc_get_part_info(part_name, &dev_desc, &part_info,
response);
@@ -219,7 +219,7 @@ static void getvar_partition_type(char *part_name, char *response)
{
int r;
struct blk_desc *dev_desc;
- disk_partition_t part_info;
+ struct disk_partition part_info;
r = fastboot_mmc_get_part_info(part_name, &dev_desc, &part_info,
response);
@@ -27,7 +27,7 @@ struct fb_mmc_sparse {
};
static int part_get_info_by_name_or_alias(struct blk_desc *dev_desc,
- const char *name, disk_partition_t *info)
+ const char *name, struct disk_partition *info)
{
int ret;
@@ -98,9 +98,9 @@ static lbaint_t fb_mmc_sparse_reserve(struct sparse_storage *info,
return blkcnt;
}
-static void write_raw_image(struct blk_desc *dev_desc, disk_partition_t *info,
- const char *part_name, void *buffer,
- u32 download_bytes, char *response)
+static void write_raw_image(struct blk_desc *dev_desc,
+ struct disk_partition *info, const char *part_name,
+ void *buffer, u32 download_bytes, char *response)
{
lbaint_t blkcnt;
lbaint_t blks;
@@ -211,7 +211,7 @@ static void fb_mmc_boot1_ops(struct blk_desc *dev_desc, void *buffer,
* @return Boot image header sectors count or 0 on error
*/
static lbaint_t fb_mmc_get_boot_header(struct blk_desc *dev_desc,
- disk_partition_t *info,
+ struct disk_partition *info,
struct andr_img_hdr *hdr,
char *response)
{
@@ -271,7 +271,7 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc,
u32 kernel_sector_start;
u32 kernel_sectors;
u32 sectors_per_page;
- disk_partition_t info;
+ struct disk_partition info;
int res;
puts("Flashing zImage\n");
@@ -367,12 +367,12 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc,
*
* @part_name: Named partition to lookup
* @dev_desc: Pointer to returned blk_desc pointer
- * @part_info: Pointer to returned disk_partition_t
+ * @part_info: Pointer to returned struct disk_partition
* @response: Pointer to fastboot response buffer
*/
int fastboot_mmc_get_part_info(const char *part_name,
struct blk_desc **dev_desc,
- disk_partition_t *part_info, char *response)
+ struct disk_partition *part_info, char *response)
{
int r;
@@ -407,7 +407,7 @@ void fastboot_mmc_flash_write(const char *cmd, void *download_buffer,
u32 download_bytes, char *response)
{
struct blk_desc *dev_desc;
- disk_partition_t info;
+ struct disk_partition info;
dev_desc = blk_get_dev("mmc", CONFIG_FASTBOOT_FLASH_MMC_DEV);
if (!dev_desc || dev_desc->type == DEV_TYPE_UNKNOWN) {
@@ -524,7 +524,7 @@ void fastboot_mmc_erase(const char *cmd, char *response)
{
int ret;
struct blk_desc *dev_desc;
- disk_partition_t info;
+ struct disk_partition info;
lbaint_t blks, blks_start, blks_size, grp_size;
struct mmc *mmc = find_mmc_device(CONFIG_FASTBOOT_FLASH_MMC_DEV);
@@ -46,7 +46,7 @@ static int env_ext4_save(void)
{
env_t env_new;
struct blk_desc *dev_desc = NULL;
- disk_partition_t info;
+ struct disk_partition info;
int dev, part;
int err;
const char *ifname = env_ext4_get_intf();
@@ -89,7 +89,7 @@ static int env_ext4_load(void)
{
ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE);
struct blk_desc *dev_desc = NULL;
- disk_partition_t info;
+ struct disk_partition info;
int dev, part;
int err;
loff_t off;
@@ -37,7 +37,7 @@ static int env_fat_save(void)
{
env_t __aligned(ARCH_DMA_MINALIGN) env_new;
struct blk_desc *dev_desc = NULL;
- disk_partition_t info;
+ struct disk_partition info;
int dev, part;
int err;
loff_t size;
@@ -84,7 +84,7 @@ static int env_fat_load(void)
{
ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE);
struct blk_desc *dev_desc = NULL;
- disk_partition_t info;
+ struct disk_partition info;
int dev, part;
int err;
@@ -27,7 +27,7 @@ DECLARE_GLOBAL_DATA_PTR;
#if CONFIG_IS_ENABLED(OF_CONTROL)
static inline int mmc_offset_try_partition(const char *str, s64 *val)
{
- disk_partition_t info;
+ struct disk_partition info;
struct blk_desc *desc;
int len, i, ret;
@@ -75,7 +75,8 @@ static int readdir_callback(const struct btrfs_root *root,
return 0;
}
-int btrfs_probe(struct blk_desc *fs_dev_desc, disk_partition_t *fs_partition)
+int btrfs_probe(struct blk_desc *fs_dev_desc,
+ struct disk_partition *fs_partition)
{
btrfs_blk_desc = fs_dev_desc;
btrfs_part_info = fs_partition;
@@ -36,7 +36,7 @@ static inline u64 btrfs_name_hash(const char *name, int len)
/* dev.c */
extern struct blk_desc *btrfs_blk_desc;
-extern disk_partition_t *btrfs_part_info;
+extern struct disk_partition *btrfs_part_info;
int btrfs_devread(u64, int, void *);
@@ -10,7 +10,7 @@
#include <fs_internal.h>
struct blk_desc *btrfs_blk_desc;
-disk_partition_t *btrfs_part_info;
+struct disk_partition *btrfs_part_info;
int btrfs_devread(u64 address, int byte_len, void *buf)
{
@@ -33,9 +33,9 @@
lbaint_t part_offset;
static struct blk_desc *ext4fs_blk_desc;
-static disk_partition_t *part_info;
+static struct disk_partition *part_info;
-void ext4fs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info)
+void ext4fs_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info)
{
assert(rbdd->blksz == (1 << rbdd->log2blksz));
ext4fs_blk_desc = rbdd;
@@ -227,7 +227,7 @@ int ext4fs_read(char *buf, loff_t offset, loff_t len, loff_t *actread)
}
int ext4fs_probe(struct blk_desc *fs_dev_desc,
- disk_partition_t *fs_partition)
+ struct disk_partition *fs_partition)
{
ext4fs_set_blk_dev(fs_dev_desc, fs_partition);
@@ -36,7 +36,7 @@ static void downcase(char *str, size_t len)
}
static struct blk_desc *cur_dev;
-static disk_partition_t cur_part_info;
+static struct disk_partition cur_part_info;
#define DOS_BOOT_MAGIC_OFFSET 0x1fe
#define DOS_FS_TYPE_OFFSET 0x36
@@ -57,7 +57,7 @@ static int disk_read(__u32 block, __u32 nr_blocks, void *buf)
return ret;
}
-int fat_set_blk_dev(struct blk_desc *dev_desc, disk_partition_t *info)
+int fat_set_blk_dev(struct blk_desc *dev_desc, struct disk_partition *info)
{
ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
@@ -88,7 +88,7 @@ int fat_set_blk_dev(struct blk_desc *dev_desc, disk_partition_t *info)
int fat_register_device(struct blk_desc *dev_desc, int part_no)
{
- disk_partition_t info;
+ struct disk_partition info;
/* First close any currently found FAT filesystem */
cur_dev = NULL;
@@ -24,11 +24,11 @@ DECLARE_GLOBAL_DATA_PTR;
static struct blk_desc *fs_dev_desc;
static int fs_dev_part;
-static disk_partition_t fs_partition;
+static struct disk_partition fs_partition;
static int fs_type = FS_TYPE_ANY;
static inline int fs_probe_unsupported(struct blk_desc *fs_dev_desc,
- disk_partition_t *fs_partition)
+ struct disk_partition *fs_partition)
{
printf("** Unrecognized filesystem type **\n");
return -1;
@@ -135,7 +135,7 @@ struct fstype_info {
*/
bool null_dev_desc_ok;
int (*probe)(struct blk_desc *fs_dev_desc,
- disk_partition_t *fs_partition);
+ struct disk_partition *fs_partition);
int (*ls)(const char *dirname);
int (*exists)(const char *filename);
int (*size)(const char *filename, loff_t *size);
@@ -10,7 +10,7 @@
#include <part.h>
#include <memalign.h>
-int fs_devread(struct blk_desc *blk, disk_partition_t *partition,
+int fs_devread(struct blk_desc *blk, struct disk_partition *partition,
lbaint_t sector, int byte_offset, int byte_len, char *buf)
{
unsigned block_len;
@@ -12,10 +12,10 @@
#include "reiserfs_private.h"
static struct blk_desc *reiserfs_blk_desc;
-static disk_partition_t *part_info;
+static struct disk_partition *part_info;
-void reiserfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info)
+void reiserfs_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info)
{
reiserfs_blk_desc = rbdd;
part_info = info;
@@ -8,7 +8,7 @@
#include <malloc.h>
#include <os.h>
-int sandbox_fs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info)
+int sandbox_fs_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info)
{
/*
* Only accept a NULL struct blk_desc for the sandbox, which is when
@@ -549,7 +549,7 @@ static unsigned long ubifs_findfile(struct super_block *sb, char *filename)
return 0;
}
-int ubifs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info)
+int ubifs_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info)
{
if (rbdd) {
debug("UBIFS cannot be used with normal block devices\n");
@@ -14,9 +14,9 @@
#include <zfs_common.h>
static struct blk_desc *zfs_blk_desc;
-static disk_partition_t *part_info;
+static struct disk_partition *part_info;
-void zfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info)
+void zfs_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info)
{
zfs_blk_desc = rbdd;
part_info = info;
@@ -29,6 +29,6 @@
* @param[in] part_info Place to store the partition information
* @return The slot number (>= 0) on success, or a negative on error
*/
-int ab_select_slot(struct blk_desc *dev_desc, disk_partition_t *part_info);
+int ab_select_slot(struct blk_desc *dev_desc, struct disk_partition *part_info);
#endif /* __ANDROID_AB_H */
@@ -38,7 +38,7 @@ struct mmc_part {
int dev_num;
struct mmc *mmc;
struct blk_desc *mmc_blk;
- disk_partition_t info;
+ struct disk_partition info;
};
enum mmc_io_type {
@@ -8,7 +8,8 @@
#ifndef __U_BOOT_BTRFS_H__
#define __U_BOOT_BTRFS_H__
-int btrfs_probe(struct blk_desc *, disk_partition_t *);
+int btrfs_probe(struct blk_desc *fs_dev_desc,
+ struct disk_partition *fs_partition);
int btrfs_ls(const char *);
int btrfs_exists(const char *);
int btrfs_size(const char *, loff_t *);
@@ -152,11 +152,11 @@ int ext4fs_exists(const char *filename);
int ext4fs_size(const char *filename, loff_t *size);
void ext4fs_free_node(struct ext2fs_node *node, struct ext2fs_node *currroot);
int ext4fs_devread(lbaint_t sector, int byte_offset, int byte_len, char *buf);
-void ext4fs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info);
+void ext4fs_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info);
long int read_allocated_block(struct ext2_inode *inode, int fileblock,
struct ext_block_cache *cache);
int ext4fs_probe(struct blk_desc *fs_dev_desc,
- disk_partition_t *fs_partition);
+ struct disk_partition *fs_partition);
int ext4_read_file(const char *filename, void *buf, loff_t offset, loff_t len,
loff_t *actread);
int ext4_read_superblock(char *buffer);
@@ -193,7 +193,7 @@ int fat_size(const char *filename, loff_t *size);
int file_fat_read_at(const char *filename, loff_t pos, void *buffer,
loff_t maxsize, loff_t *actread);
int file_fat_read(const char *filename, void *buffer, int maxsize);
-int fat_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info);
+int fat_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info);
int fat_register_device(struct blk_desc *dev_desc, int part_no);
int file_fat_write(const char *filename, void *buf, loff_t offset, loff_t len,
@@ -11,12 +11,13 @@
*
* @part_name: Named partition to lookup
* @dev_desc: Pointer to returned blk_desc pointer
- * @part_info: Pointer to returned disk_partition_t
+ * @part_info: Pointer to returned struct disk_partition
* @response: Pointer to fastboot response buffer
*/
int fastboot_mmc_get_part_info(const char *part_name,
struct blk_desc **dev_desc,
- disk_partition_t *part_info, char *response);
+ struct disk_partition *part_info,
+ char *response);
/**
* fastboot_mmc_flash_write() - Write image to eMMC for fastboot
@@ -10,7 +10,7 @@
#include <part.h>
-int fs_devread(struct blk_desc *, disk_partition_t *, lbaint_t, int, int,
+int fs_devread(struct blk_desc *, struct disk_partition *, lbaint_t, int, int,
char *);
#endif /* __U_BOOT_FS_INTERNAL_H__ */
@@ -51,7 +51,7 @@ struct block_drvr {
#define PART_TYPE_LEN 32
#define MAX_SEARCH_PARTITIONS 64
-typedef struct disk_partition {
+struct disk_partition {
lbaint_t start; /* # of first block in partition */
lbaint_t size; /* number of blocks in partition */
ulong blksz; /* block size in bytes */
@@ -67,11 +67,11 @@ typedef struct disk_partition {
#ifdef CONFIG_DOS_PARTITION
uchar sys_ind; /* partition type */
#endif
-} disk_partition_t;
+};
struct disk_part {
int partnum;
- disk_partition_t gpt_part_info;
+ struct disk_partition gpt_part_info;
struct list_head list;
};
@@ -96,12 +96,14 @@ struct blk_desc *mg_disk_get_dev(int dev);
int host_get_dev_err(int dev, struct blk_desc **blk_devp);
/* disk/part.c */
-int part_get_info(struct blk_desc *dev_desc, int part, disk_partition_t *info);
+int part_get_info(struct blk_desc *dev_desc, int part,
+ struct disk_partition *info);
/**
* part_get_info_whole_disk() - get partition info for the special case of
* a partition occupying the entire disk.
*/
-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);
void part_print(struct blk_desc *dev_desc);
void part_init(struct blk_desc *dev_desc);
@@ -170,7 +172,7 @@ int blk_get_device_by_str(const char *ifname, const char *dev_str,
*/
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);
/**
* part_get_info_by_name_type() - Search for a partition by name
@@ -185,7 +187,7 @@ int blk_get_device_part_str(const char *ifname, const char *dev_part_str,
* otherwise error
*/
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);
/**
* part_get_info_by_name() - Search for a partition by name
@@ -199,7 +201,7 @@ int part_get_info_by_name_type(struct blk_desc *dev_desc, const char *name,
* otherwise error
*/
int part_get_info_by_name(struct blk_desc *dev_desc,
- const char *name, disk_partition_t *info);
+ const char *name, struct disk_partition *info);
/**
* Get partition info from dev number + part name, or dev number + part number.
@@ -220,7 +222,7 @@ int part_get_info_by_name(struct blk_desc *dev_desc,
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);
/**
* part_set_generic_name() - create generic partition like hda1 or sdb2
@@ -243,9 +245,9 @@ static inline struct blk_desc *blk_get_dev(const char *ifname, int dev)
static inline struct blk_desc *mg_disk_get_dev(int dev) { return NULL; }
static inline int part_get_info(struct blk_desc *dev_desc, int part,
- disk_partition_t *info) { return -1; }
+ struct disk_partition *info) { return -1; }
static inline int part_get_info_whole_disk(struct blk_desc *dev_desc,
- disk_partition_t *info)
+ struct disk_partition *info)
{ return -1; }
static inline void part_print(struct blk_desc *dev_desc) {}
static inline void part_init(struct blk_desc *dev_desc) {}
@@ -254,10 +256,10 @@ static inline int blk_get_device_by_str(const char *ifname, const char *dev_str,
struct blk_desc **dev_desc)
{ return -1; }
static inline 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)
+ const char *dev_part_str,
+ struct blk_desc **dev_desc,
+ struct disk_partition *info,
+ int allow_whole_dev)
{ *dev_desc = NULL; return -1; }
#endif
@@ -292,7 +294,7 @@ struct part_driver {
* @info: Returns partition information
*/
int (*get_info)(struct blk_desc *dev_desc, int part,
- disk_partition_t *info);
+ struct disk_partition *info);
/**
* print() - Print partition information
@@ -344,7 +346,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);
/**
* gpt_fill_header(): Fill the GPT header
@@ -370,7 +372,7 @@ int gpt_fill_header(struct blk_desc *dev_desc, gpt_header *gpt_h,
* @return zero on success
*/
int gpt_restore(struct blk_desc *dev_desc, char *str_disk_guid,
- disk_partition_t *partitions, const int parts_count);
+ struct disk_partition *partitions, const int parts_count);
/**
* is_valid_gpt_buf() - Ensure that the Primary GPT information is valid
@@ -424,7 +426,7 @@ int gpt_verify_headers(struct blk_desc *dev_desc, gpt_header *gpt_head,
* @return - '0' on success, otherwise error
*/
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);
@@ -62,7 +62,7 @@ typedef enum
} reiserfs_error_t;
-void reiserfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info);
+void reiserfs_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info);
extern int reiserfs_ls (char *dirname);
extern int reiserfs_open (char *filename);
extern int reiserfs_read (char *buf, unsigned len);
@@ -18,7 +18,7 @@
#ifndef __SANDBOX_FS__
#define __SANDBOX_FS__
-int sandbox_fs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info);
+int sandbox_fs_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info);
int sandbox_fs_read_at(const char *filename, loff_t pos, void *buffer,
loff_t maxsize, loff_t *actread);
@@ -20,7 +20,7 @@ void uboot_ubifs_umount(void);
int ubifs_is_mounted(void);
int ubifs_load(char *filename, u32 addr, u32 size);
-int ubifs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info);
+int ubifs_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info);
int ubifs_ls(const char *dir_name);
int ubifs_exists(const char *filename);
int ubifs_size(const char *filename, loff_t *size);
@@ -98,7 +98,7 @@ int zfs_close(zfs_file_t);
int zfs_ls(device_t dev, const char *path,
int (*hook) (const char *, const struct zfs_dirhook_info *));
int zfs_devread(int sector, int byte_offset, int byte_len, char *buf);
-void zfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info);
+void zfs_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info);
void zfs_unmount(struct zfs_data *data);
int lzjb_decompress(void *, void *, uint32_t, uint32_t);
#endif
@@ -694,7 +694,7 @@ static unsigned dp_part_size(struct blk_desc *desc, int part)
*/
static void *dp_part_node(void *buf, struct blk_desc *desc, int part)
{
- disk_partition_t info;
+ struct disk_partition info;
part_get_info(desc, part, &info);
@@ -1036,7 +1036,7 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr,
{
int is_net;
struct blk_desc *desc = NULL;
- disk_partition_t fs_partition;
+ struct disk_partition fs_partition;
int part = 0;
char filename[32] = { 0 }; /* dp->str is u16[32] long */
char *s;
@@ -393,7 +393,7 @@ int efi_disk_create_partitions(efi_handle_t parent, struct blk_desc *desc,
{
int disks = 0;
char devname[32] = { 0 }; /* dp->str is u16[32] long */
- disk_partition_t info;
+ struct disk_partition info;
int part;
struct efi_device_path *dp = NULL;
efi_status_t ret;
@@ -634,7 +634,7 @@ static efi_status_t EFIAPI efi_file_getinfo(struct efi_file_handle *file,
utf8_utf16_strcpy(&dst, filename);
} else if (!guidcmp(info_type, &efi_file_system_info_guid)) {
struct efi_file_system_info *info = buffer;
- disk_partition_t part;
+ struct disk_partition part;
efi_uintn_t required_size;
int r;
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 at chromium.org> --- Changes in v2: None arch/arm/mach-omap2/utils.c | 2 +- arch/x86/cpu/quark/quark.c | 1 + 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 ++-- common/android_ab.c | 6 ++--- common/spl/spl_ext.c | 4 ++-- common/spl/spl_mmc.c | 2 +- disk/part.c | 17 +++++++------- disk/part_amiga.c | 2 +- disk/part_dos.c | 4 ++-- disk/part_efi.c | 8 +++---- disk/part_iso.c | 8 +++---- disk/part_mac.c | 2 +- drivers/dfu/dfu_mmc.c | 2 +- drivers/fastboot/fb_getvar.c | 4 ++-- drivers/fastboot/fb_mmc.c | 20 ++++++++-------- env/ext4.c | 4 ++-- env/fat.c | 4 ++-- env/mmc.c | 2 +- fs/btrfs/btrfs.c | 3 ++- fs/btrfs/btrfs.h | 2 +- fs/btrfs/dev.c | 2 +- fs/ext4/dev.c | 4 ++-- fs/ext4/ext4fs.c | 2 +- fs/fat/fat.c | 6 ++--- fs/fs.c | 6 ++--- fs/fs_internal.c | 2 +- fs/reiserfs/dev.c | 4 ++-- fs/sandbox/sandboxfs.c | 2 +- fs/ubifs/ubifs.c | 2 +- fs/zfs/dev.c | 4 ++-- include/android_ab.h | 2 +- include/avb_verify.h | 2 +- include/btrfs.h | 3 ++- include/ext4fs.h | 4 ++-- include/fat.h | 2 +- include/fb_mmc.h | 5 ++-- include/fs_internal.h | 2 +- include/part.h | 40 +++++++++++++++++--------------- include/reiserfs.h | 2 +- include/sandboxfs.h | 2 +- include/ubifs_uboot.h | 2 +- include/zfs_common.h | 2 +- lib/efi_loader/efi_device_path.c | 4 ++-- lib/efi_loader/efi_disk.c | 2 +- lib/efi_loader/efi_file.c | 2 +- 54 files changed, 131 insertions(+), 123 deletions(-)