From 4101f6879256720b30df712089a3df18565f9203 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 29 Feb 2016 15:25:34 -0700 Subject: dm: Drop the block_dev_desc_t typedef Use 'struct' instead of a typdef. Also since 'struct block_dev_desc' is long and causes 80-column violations, rename it to struct blk_desc. Signed-off-by: Simon Glass Reviewed-by: Bin Meng Tested-by: Stephen Warren --- common/env_fat.c | 4 ++-- common/fb_mmc.c | 12 ++++++------ common/spl/spl_ext.c | 6 +++--- common/spl/spl_fat.c | 8 ++++---- common/spl/spl_sata.c | 2 +- common/spl/spl_usb.c | 2 +- common/usb_storage.c | 22 +++++++++++----------- 7 files changed, 28 insertions(+), 28 deletions(-) (limited to 'common') diff --git a/common/env_fat.c b/common/env_fat.c index d79d864..e88279e 100644 --- a/common/env_fat.c +++ b/common/env_fat.c @@ -38,7 +38,7 @@ int env_init(void) int saveenv(void) { env_t env_new; - block_dev_desc_t *dev_desc = NULL; + struct blk_desc *dev_desc = NULL; disk_partition_t info; int dev, part; int err; @@ -77,7 +77,7 @@ int saveenv(void) void env_relocate_spec(void) { ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE); - block_dev_desc_t *dev_desc = NULL; + struct blk_desc *dev_desc = NULL; disk_partition_t info; int dev, part; int err; diff --git a/common/fb_mmc.c b/common/fb_mmc.c index 6e742da..fd43085 100644 --- a/common/fb_mmc.c +++ b/common/fb_mmc.c @@ -22,10 +22,10 @@ static char *response_str; struct fb_mmc_sparse { - block_dev_desc_t *dev_desc; + struct blk_desc *dev_desc; }; -static int get_partition_info_efi_by_name_or_alias(block_dev_desc_t *dev_desc, +static int get_partition_info_efi_by_name_or_alias(struct blk_desc *dev_desc, const char *name, disk_partition_t *info) { int ret; @@ -55,7 +55,7 @@ static int fb_mmc_sparse_write(struct sparse_storage *storage, char *data) { struct fb_mmc_sparse *sparse = priv; - block_dev_desc_t *dev_desc = sparse->dev_desc; + struct blk_desc *dev_desc = sparse->dev_desc; int ret; ret = dev_desc->block_write(dev_desc, offset, size, data); @@ -65,7 +65,7 @@ static int fb_mmc_sparse_write(struct sparse_storage *storage, return ret; } -static void write_raw_image(block_dev_desc_t *dev_desc, disk_partition_t *info, +static void write_raw_image(struct blk_desc *dev_desc, disk_partition_t *info, const char *part_name, void *buffer, unsigned int download_bytes) { @@ -100,7 +100,7 @@ void fb_mmc_flash_write(const char *cmd, unsigned int session_id, void *download_buffer, unsigned int download_bytes, char *response) { - block_dev_desc_t *dev_desc; + struct blk_desc *dev_desc; disk_partition_t info; /* initialize the response buffer */ @@ -165,7 +165,7 @@ void fb_mmc_flash_write(const char *cmd, unsigned int session_id, void fb_mmc_erase(const char *cmd, char *response) { int ret; - block_dev_desc_t *dev_desc; + struct blk_desc *dev_desc; disk_partition_t info; lbaint_t blks, blks_start, blks_size, grp_size; struct mmc *mmc = find_mmc_device(CONFIG_FASTBOOT_FLASH_MMC_DEV); diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c index a42fbd0..d29d229 100644 --- a/common/spl/spl_ext.c +++ b/common/spl/spl_ext.c @@ -10,7 +10,7 @@ #include #ifdef CONFIG_SPL_EXT_SUPPORT -int spl_load_image_ext(block_dev_desc_t *block_dev, +int spl_load_image_ext(struct blk_desc *block_dev, int partition, const char *filename) { @@ -64,7 +64,7 @@ end: } #ifdef CONFIG_SPL_OS_BOOT -int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition) +int spl_load_image_ext_os(struct blk_desc *block_dev, int partition) { int err; __maybe_unused loff_t filelen, actlen; @@ -137,7 +137,7 @@ defaults: CONFIG_SPL_FS_LOAD_KERNEL_NAME); } #else -int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition) +int spl_load_image_ext_os(struct blk_desc *block_dev, int partition) { return -ENOSYS; } diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c index 0daadbe..d761b26 100644 --- a/common/spl/spl_fat.c +++ b/common/spl/spl_fat.c @@ -19,7 +19,7 @@ static int fat_registered; #ifdef CONFIG_SPL_FAT_SUPPORT -static int spl_register_fat_device(block_dev_desc_t *block_dev, int partition) +static int spl_register_fat_device(struct blk_desc *block_dev, int partition) { int err = 0; @@ -39,7 +39,7 @@ static int spl_register_fat_device(block_dev_desc_t *block_dev, int partition) return err; } -int spl_load_image_fat(block_dev_desc_t *block_dev, +int spl_load_image_fat(struct blk_desc *block_dev, int partition, const char *filename) { @@ -72,7 +72,7 @@ end: } #ifdef CONFIG_SPL_OS_BOOT -int spl_load_image_fat_os(block_dev_desc_t *block_dev, int partition) +int spl_load_image_fat_os(struct blk_desc *block_dev, int partition) { int err; __maybe_unused char *file; @@ -121,7 +121,7 @@ defaults: CONFIG_SPL_FS_LOAD_KERNEL_NAME); } #else -int spl_load_image_fat_os(block_dev_desc_t *block_dev, int partition) +int spl_load_image_fat_os(struct blk_desc *block_dev, int partition) { return -ENOSYS; } diff --git a/common/spl/spl_sata.c b/common/spl/spl_sata.c index 3ba4c24..1719946 100644 --- a/common/spl/spl_sata.c +++ b/common/spl/spl_sata.c @@ -23,7 +23,7 @@ DECLARE_GLOBAL_DATA_PTR; int spl_sata_load_image(void) { int err; - block_dev_desc_t *stor_dev; + struct blk_desc *stor_dev; err = init_sata(CONFIG_SPL_SATA_BOOT_DEVICE); if (err) { diff --git a/common/spl/spl_usb.c b/common/spl/spl_usb.c index 588b85c..c42848e 100644 --- a/common/spl/spl_usb.c +++ b/common/spl/spl_usb.c @@ -25,7 +25,7 @@ static int usb_stor_curr_dev = -1; /* current device */ int spl_usb_load_image(void) { int err; - block_dev_desc_t *stor_dev; + struct blk_desc *stor_dev; usb_stop(); err = usb_init(); diff --git a/common/usb_storage.c b/common/usb_storage.c index 8737cf7..ca5aeea 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -67,7 +67,7 @@ static __u32 CBWTag; static int usb_max_devs; /* number of highest available usb device */ -static block_dev_desc_t usb_dev_desc[USB_MAX_STOR_DEV]; +static struct blk_desc usb_dev_desc[USB_MAX_STOR_DEV]; struct us_data; typedef int (*trans_cmnd)(ccb *cb, struct us_data *data); @@ -115,17 +115,17 @@ static struct us_data usb_stor[USB_MAX_STOR_DEV]; #define USB_STOR_TRANSPORT_ERROR -2 int usb_stor_get_info(struct usb_device *dev, struct us_data *us, - block_dev_desc_t *dev_desc); + struct blk_desc *dev_desc); int usb_storage_probe(struct usb_device *dev, unsigned int ifnum, struct us_data *ss); -static unsigned long usb_stor_read(block_dev_desc_t *block_dev, lbaint_t blknr, +static unsigned long usb_stor_read(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt, void *buffer); -static unsigned long usb_stor_write(block_dev_desc_t *block_dev, lbaint_t blknr, +static unsigned long usb_stor_write(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt, const void *buffer); void uhci_show_temp_int_td(void); #ifdef CONFIG_PARTITIONS -block_dev_desc_t *usb_stor_get_dev(int index) +struct blk_desc *usb_stor_get_dev(int index) { return (index < usb_max_devs) ? &usb_dev_desc[index] : NULL; } @@ -187,10 +187,10 @@ static int usb_stor_probe_device(struct usb_device *dev) for (lun = 0; lun <= max_lun && usb_max_devs < USB_MAX_STOR_DEV; lun++) { - struct block_dev_desc *blkdev; + struct blk_desc *blkdev; blkdev = &usb_dev_desc[usb_max_devs]; - memset(blkdev, '\0', sizeof(block_dev_desc_t)); + memset(blkdev, '\0', sizeof(struct blk_desc)); blkdev->if_type = IF_TYPE_USB; blkdev->dev = usb_max_devs; blkdev->part_type = PART_TYPE_UNKNOWN; @@ -1011,7 +1011,7 @@ static int usb_write_10(ccb *srb, struct us_data *ss, unsigned long start, * device with proper values (as reported by 'usb info'). * * Vendor and product length limits are taken from the definition of - * block_dev_desc_t in include/part.h. + * struct blk_desc in include/part.h. */ static void usb_bin_fixup(struct usb_device_descriptor descriptor, unsigned char vendor[], @@ -1026,7 +1026,7 @@ static void usb_bin_fixup(struct usb_device_descriptor descriptor, } #endif /* CONFIG_USB_BIN_FIXUP */ -static unsigned long usb_stor_read(block_dev_desc_t *block_dev, lbaint_t blknr, +static unsigned long usb_stor_read(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt, void *buffer) { int device = block_dev->dev; @@ -1097,7 +1097,7 @@ retry_it: return blkcnt; } -static unsigned long usb_stor_write(block_dev_desc_t *block_dev, lbaint_t blknr, +static unsigned long usb_stor_write(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt, const void *buffer) { int device = block_dev->dev; @@ -1289,7 +1289,7 @@ int usb_storage_probe(struct usb_device *dev, unsigned int ifnum, } int usb_stor_get_info(struct usb_device *dev, struct us_data *ss, - block_dev_desc_t *dev_desc) + struct blk_desc *dev_desc) { unsigned char perq, modi; ALLOC_CACHE_ALIGN_BUFFER(u32, cap, 2); -- cgit v1.1