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 <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
diff --git a/include/common.h b/include/common.h
index 1563d64..1317f9b 100644
--- a/include/common.h
+++ b/include/common.h
@@ -813,7 +813,7 @@
  *				for files under 4GiB
  */
 int gzwrite(unsigned char *src, int len,
-	    struct block_dev_desc *dev,
+	    struct blk_desc *dev,
 	    unsigned long szwritebuf,
 	    u64 startoffs,
 	    u64 szexpected);
diff --git a/include/ext4fs.h b/include/ext4fs.h
index 6888adc..cc765ae 100644
--- a/include/ext4fs.h
+++ b/include/ext4fs.h
@@ -110,7 +110,7 @@
 	/* Journal Related */
 
 	/* Block Device Descriptor */
-	block_dev_desc_t *dev_desc;
+	struct blk_desc *dev_desc;
 };
 
 extern struct ext2_data *ext4fs_root;
@@ -141,9 +141,9 @@
 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(block_dev_desc_t *rbdd, disk_partition_t *info);
+void ext4fs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info);
 long int read_allocated_block(struct ext2_inode *inode, int fileblock);
-int ext4fs_probe(block_dev_desc_t *fs_dev_desc,
+int ext4fs_probe(struct blk_desc *fs_dev_desc,
 		 disk_partition_t *fs_partition);
 int ext4_read_file(const char *filename, void *buf, loff_t offset, loff_t len,
 		   loff_t *actread);
diff --git a/include/fat.h b/include/fat.h
index 3038bd7..9d053e6 100644
--- a/include/fat.h
+++ b/include/fat.h
@@ -203,8 +203,8 @@
 		     loff_t maxsize, loff_t *actread);
 int file_fat_read(const char *filename, void *buffer, int maxsize);
 const char *file_getfsname(int idx);
-int fat_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info);
-int fat_register_device(block_dev_desc_t *dev_desc, int part_no);
+int fat_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *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,
 		   loff_t *actwrite);
diff --git a/include/ide.h b/include/ide.h
index f9357be..2407393 100644
--- a/include/ide.h
+++ b/include/ide.h
@@ -41,10 +41,10 @@
  */
 
 void ide_init(void);
-typedef struct block_dev_desc block_dev_desc_t;
-ulong ide_read(block_dev_desc_t *block_dev, lbaint_t blknr, lbaint_t blkcnt,
+struct blk_desc;
+ulong ide_read(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt,
 	       void *buffer);
-ulong ide_write(block_dev_desc_t *block_dev, lbaint_t blknr, lbaint_t blkcnt,
+ulong ide_write(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt,
 		const void *buffer);
 
 #ifdef CONFIG_IDE_PREINIT
diff --git a/include/mmc.h b/include/mmc.h
index d652c14..cdb56e7 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -376,7 +376,7 @@
 	u64 capacity_gp[4];
 	u64 enh_user_start;
 	u64 enh_user_size;
-	block_dev_desc_t block_dev;
+	struct blk_desc block_dev;
 	char op_cond_pending;	/* 1 if we are waiting on an op_cond command */
 	char init_in_progress;	/* 1 if we have done mmc_start_init() */
 	char preinit;		/* start init as early as possible */
diff --git a/include/part.h b/include/part.h
index dc23949..d1e9d0f 100644
--- a/include/part.h
+++ b/include/part.h
@@ -10,7 +10,7 @@
 #include <ide.h>
 #include <common.h>
 
-struct block_dev_desc {
+struct blk_desc {
 	int		if_type;	/* type of the interface */
 	int		dev;		/* device number */
 	unsigned char	part_type;	/* partition type */
@@ -28,23 +28,23 @@
 	char		vendor [40+1];	/* IDE model, SCSI Vendor */
 	char		product[20+1];	/* IDE Serial no, SCSI product */
 	char		revision[8+1];	/* firmware revision */
-	unsigned long	(*block_read)(block_dev_desc_t *block_dev,
+	unsigned long	(*block_read)(struct blk_desc *block_dev,
 				      lbaint_t start,
 				      lbaint_t blkcnt,
 				      void *buffer);
-	unsigned long	(*block_write)(block_dev_desc_t *block_dev,
+	unsigned long	(*block_write)(struct blk_desc *block_dev,
 				       lbaint_t start,
 				       lbaint_t blkcnt,
 				       const void *buffer);
-	unsigned long	(*block_erase)(block_dev_desc_t *block_dev,
+	unsigned long	(*block_erase)(struct blk_desc *block_dev,
 				       lbaint_t start,
 				       lbaint_t blkcnt);
 	void		*priv;		/* driver private struct pointer */
 };
 
-#define BLOCK_CNT(size, block_dev_desc) (PAD_COUNT(size, block_dev_desc->blksz))
-#define PAD_TO_BLOCKSIZE(size, block_dev_desc) \
-	(PAD_SIZE(size, block_dev_desc->blksz))
+#define BLOCK_CNT(size, blk_desc) (PAD_COUNT(size, blk_desc->blksz))
+#define PAD_TO_BLOCKSIZE(size, blk_desc) \
+	(PAD_SIZE(size, blk_desc->blksz))
 #define LOG2(x) (((x & 0xaaaaaaaa) ? 1 : 0) + ((x & 0xcccccccc) ? 2 : 0) + \
 		 ((x & 0xf0f0f0f0) ? 4 : 0) + ((x & 0xff00ff00) ? 8 : 0) + \
 		 ((x & 0xffff0000) ? 16 : 0))
@@ -101,52 +101,53 @@
 
 /* Misc _get_dev functions */
 #ifdef CONFIG_PARTITIONS
-block_dev_desc_t *get_dev(const char *ifname, int dev);
-block_dev_desc_t* ide_get_dev(int dev);
-block_dev_desc_t* sata_get_dev(int dev);
-block_dev_desc_t* scsi_get_dev(int dev);
-block_dev_desc_t* usb_stor_get_dev(int dev);
-block_dev_desc_t* mmc_get_dev(int dev);
+struct blk_desc *get_dev(const char *ifname, int dev);
+struct blk_desc *ide_get_dev(int dev);
+struct blk_desc *sata_get_dev(int dev);
+struct blk_desc *scsi_get_dev(int dev);
+struct blk_desc *usb_stor_get_dev(int dev);
+struct blk_desc *mmc_get_dev(int dev);
 int mmc_select_hwpart(int dev_num, int hwpart);
-block_dev_desc_t* systemace_get_dev(int dev);
-block_dev_desc_t* mg_disk_get_dev(int dev);
-block_dev_desc_t *host_get_dev(int dev);
-int host_get_dev_err(int dev, block_dev_desc_t **blk_devp);
+struct blk_desc *systemace_get_dev(int dev);
+struct blk_desc *mg_disk_get_dev(int dev);
+struct blk_desc *host_get_dev(int dev);
+int host_get_dev_err(int dev, struct blk_desc **blk_devp);
 
 /* disk/part.c */
-int get_partition_info (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
-void print_part (block_dev_desc_t *dev_desc);
-void  init_part (block_dev_desc_t *dev_desc);
-void dev_print(block_dev_desc_t *dev_desc);
+int get_partition_info(struct blk_desc *dev_desc, int part,
+		       disk_partition_t *info);
+void print_part(struct blk_desc *dev_desc);
+void init_part(struct blk_desc *dev_desc);
+void dev_print(struct blk_desc *dev_desc);
 int get_device(const char *ifname, const char *dev_str,
-	       block_dev_desc_t **dev_desc);
+	       struct blk_desc **dev_desc);
 int get_device_and_partition(const char *ifname, const char *dev_part_str,
-			     block_dev_desc_t **dev_desc,
+			     struct blk_desc **dev_desc,
 			     disk_partition_t *info, int allow_whole_dev);
 #else
-static inline block_dev_desc_t *get_dev(const char *ifname, int dev)
+static inline struct blk_desc *get_dev(const char *ifname, int dev)
 { return NULL; }
-static inline block_dev_desc_t* ide_get_dev(int dev) { return NULL; }
-static inline block_dev_desc_t* sata_get_dev(int dev) { return NULL; }
-static inline block_dev_desc_t* scsi_get_dev(int dev) { return NULL; }
-static inline block_dev_desc_t* usb_stor_get_dev(int dev) { return NULL; }
-static inline block_dev_desc_t* mmc_get_dev(int dev) { return NULL; }
+static inline struct blk_desc *ide_get_dev(int dev) { return NULL; }
+static inline struct blk_desc *sata_get_dev(int dev) { return NULL; }
+static inline struct blk_desc *scsi_get_dev(int dev) { return NULL; }
+static inline struct blk_desc *usb_stor_get_dev(int dev) { return NULL; }
+static inline struct blk_desc *mmc_get_dev(int dev) { return NULL; }
 static inline int mmc_select_hwpart(int dev_num, int hwpart) { return -1; }
-static inline block_dev_desc_t* systemace_get_dev(int dev) { return NULL; }
-static inline block_dev_desc_t* mg_disk_get_dev(int dev) { return NULL; }
-static inline block_dev_desc_t *host_get_dev(int dev) { return NULL; }
+static inline struct blk_desc *systemace_get_dev(int dev) { return NULL; }
+static inline struct blk_desc *mg_disk_get_dev(int dev) { return NULL; }
+static inline struct blk_desc *host_get_dev(int dev) { return NULL; }
 
-static inline int get_partition_info (block_dev_desc_t * dev_desc, int part,
-	disk_partition_t *info) { return -1; }
-static inline void print_part (block_dev_desc_t *dev_desc) {}
-static inline void  init_part (block_dev_desc_t *dev_desc) {}
-static inline void dev_print(block_dev_desc_t *dev_desc) {}
+static inline int get_partition_info(struct blk_desc *dev_desc, int part,
+				     disk_partition_t *info) { return -1; }
+static inline void print_part(struct blk_desc *dev_desc) {}
+static inline void init_part(struct blk_desc *dev_desc) {}
+static inline void dev_print(struct blk_desc *dev_desc) {}
 static inline int get_device(const char *ifname, const char *dev_str,
-	       block_dev_desc_t **dev_desc)
+			     struct blk_desc **dev_desc)
 { return -1; }
 static inline int get_device_and_partition(const char *ifname,
 					   const char *dev_part_str,
-					   block_dev_desc_t **dev_desc,
+					   struct blk_desc **dev_desc,
 					   disk_partition_t *info,
 					   int allow_whole_dev)
 { *dev_desc = NULL; return -1; }
@@ -154,36 +155,41 @@
 
 #ifdef CONFIG_MAC_PARTITION
 /* disk/part_mac.c */
-int get_partition_info_mac (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
-void print_part_mac (block_dev_desc_t *dev_desc);
-int   test_part_mac (block_dev_desc_t *dev_desc);
+int get_partition_info_mac(struct blk_desc *dev_desc, int part,
+			   disk_partition_t *info);
+void print_part_mac(struct blk_desc *dev_desc);
+int test_part_mac(struct blk_desc *dev_desc);
 #endif
 
 #ifdef CONFIG_DOS_PARTITION
 /* disk/part_dos.c */
-int get_partition_info_dos (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
-void print_part_dos (block_dev_desc_t *dev_desc);
-int   test_part_dos (block_dev_desc_t *dev_desc);
+int get_partition_info_dos(struct blk_desc *dev_desc, int part,
+			   disk_partition_t *info);
+void print_part_dos(struct blk_desc *dev_desc);
+int test_part_dos(struct blk_desc *dev_desc);
 #endif
 
 #ifdef CONFIG_ISO_PARTITION
 /* disk/part_iso.c */
-int get_partition_info_iso (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
-void print_part_iso (block_dev_desc_t *dev_desc);
-int   test_part_iso (block_dev_desc_t *dev_desc);
+int get_partition_info_iso(struct blk_desc *dev_desc, int part,
+			   disk_partition_t *info);
+void print_part_iso(struct blk_desc *dev_desc);
+int test_part_iso(struct blk_desc *dev_desc);
 #endif
 
 #ifdef CONFIG_AMIGA_PARTITION
 /* disk/part_amiga.c */
-int get_partition_info_amiga (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
-void print_part_amiga (block_dev_desc_t *dev_desc);
-int   test_part_amiga (block_dev_desc_t *dev_desc);
+int get_partition_info_amiga(struct blk_desc *dev_desc, int part,
+			     disk_partition_t *info);
+void print_part_amiga(struct blk_desc *dev_desc);
+int test_part_amiga(struct blk_desc *dev_desc);
 #endif
 
 #ifdef CONFIG_EFI_PARTITION
 #include <part_efi.h>
 /* disk/part_efi.c */
-int get_partition_info_efi (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
+int get_partition_info_efi(struct blk_desc *dev_desc, int part,
+			   disk_partition_t *info);
 /**
  * get_partition_info_efi_by_name() - Find the specified GPT partition table entry
  *
@@ -193,10 +199,10 @@
  *
  * @return - '0' on match, '-1' on no match, otherwise error
  */
-int get_partition_info_efi_by_name(block_dev_desc_t *dev_desc,
+int get_partition_info_efi_by_name(struct blk_desc *dev_desc,
 	const char *name, disk_partition_t *info);
-void print_part_efi (block_dev_desc_t *dev_desc);
-int   test_part_efi (block_dev_desc_t *dev_desc);
+void print_part_efi(struct blk_desc *dev_desc);
+int test_part_efi(struct blk_desc *dev_desc);
 
 /**
  * write_gpt_table() - Write the GUID Partition Table to disk
@@ -207,7 +213,7 @@
  *
  * @return - zero on success, otherwise error
  */
-int write_gpt_table(block_dev_desc_t *dev_desc,
+int write_gpt_table(struct blk_desc *dev_desc,
 		  gpt_header *gpt_h, gpt_entry *gpt_e);
 
 /**
@@ -233,7 +239,7 @@
  *
  * @return - error on str_guid conversion error
  */
-int gpt_fill_header(block_dev_desc_t *dev_desc, gpt_header *gpt_h,
+int gpt_fill_header(struct blk_desc *dev_desc, gpt_header *gpt_h,
 		char *str_guid, int parts_count);
 
 /**
@@ -246,7 +252,7 @@
  *
  * @return zero on success
  */
-int gpt_restore(block_dev_desc_t *dev_desc, char *str_disk_guid,
+int gpt_restore(struct blk_desc *dev_desc, char *str_disk_guid,
 		disk_partition_t *partitions, const int parts_count);
 
 /**
@@ -257,7 +263,7 @@
  *
  * @return - '0' on success, otherwise error
  */
-int is_valid_gpt_buf(block_dev_desc_t *dev_desc, void *buf);
+int is_valid_gpt_buf(struct blk_desc *dev_desc, void *buf);
 
 /**
  * write_mbr_and_gpt_partitions() - write MBR, Primary GPT and Backup GPT
@@ -267,7 +273,7 @@
  *
  * @return - '0' on success, otherwise error
  */
-int write_mbr_and_gpt_partitions(block_dev_desc_t *dev_desc, void *buf);
+int write_mbr_and_gpt_partitions(struct blk_desc *dev_desc, void *buf);
 
 /**
  * gpt_verify_headers() - Function to read and CRC32 check of the GPT's header
@@ -281,7 +287,7 @@
  *
  * @return - '0' on success, otherwise error
  */
-int gpt_verify_headers(block_dev_desc_t *dev_desc, gpt_header *gpt_head,
+int gpt_verify_headers(struct blk_desc *dev_desc, gpt_header *gpt_head,
 		       gpt_entry **gpt_pte);
 
 /**
@@ -300,7 +306,7 @@
  *
  * @return - '0' on success, otherwise error
  */
-int gpt_verify_partitions(block_dev_desc_t *dev_desc,
+int gpt_verify_partitions(struct blk_desc *dev_desc,
 			  disk_partition_t *partitions, int parts,
 			  gpt_header *gpt_head, gpt_entry **gpt_pte);
 #endif
diff --git a/include/reiserfs.h b/include/reiserfs.h
index 2d14d48..ffe4e46 100644
--- a/include/reiserfs.h
+++ b/include/reiserfs.h
@@ -63,7 +63,7 @@
 } reiserfs_error_t;
 
 
-extern void reiserfs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info);
+void reiserfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info);
 extern int reiserfs_ls (char *dirname);
 extern int reiserfs_open (char *filename);
 extern int reiserfs_read (char *buf, unsigned len);
diff --git a/include/sandboxblockdev.h b/include/sandboxblockdev.h
index 627787a..59f9519 100644
--- a/include/sandboxblockdev.h
+++ b/include/sandboxblockdev.h
@@ -8,7 +8,7 @@
 #define __SANDBOX_BLOCK_DEV__
 
 struct host_block_dev {
-	block_dev_desc_t blk_dev;
+	struct blk_desc blk_dev;
 	char *filename;
 	int fd;
 };
diff --git a/include/sandboxfs.h b/include/sandboxfs.h
index 4c7745d..6e6e3c6 100644
--- a/include/sandboxfs.h
+++ b/include/sandboxfs.h
@@ -18,7 +18,7 @@
 #ifndef __SANDBOX_FS__
 #define __SANDBOX_FS__
 
-int sandbox_fs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info);
+int sandbox_fs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info);
 
 int sandbox_fs_read_at(const char *filename, loff_t pos, void *buffer,
 		       loff_t maxsize, loff_t *actread);
diff --git a/include/sata.h b/include/sata.h
index fa61da8..b35359a 100644
--- a/include/sata.h
+++ b/include/sata.h
@@ -14,6 +14,6 @@
 int __sata_stop(void);
 int sata_port_status(int dev, int port);
 
-extern block_dev_desc_t sata_dev_desc[];
+extern struct blk_desc sata_dev_desc[];
 
 #endif
diff --git a/include/spl.h b/include/spl.h
index 92cdc04..c62887a 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -72,14 +72,16 @@
 int spl_sata_load_image(void);
 
 /* SPL FAT image functions */
-int spl_load_image_fat(block_dev_desc_t *block_dev, int partition, const char *filename);
-int spl_load_image_fat_os(block_dev_desc_t *block_dev, int partition);
+int spl_load_image_fat(struct blk_desc *block_dev, int partition,
+		       const char *filename);
+int spl_load_image_fat_os(struct blk_desc *block_dev, int partition);
 
 void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image);
 
 /* SPL EXT image functions */
-int spl_load_image_ext(block_dev_desc_t *block_dev, int partition, const char *filename);
-int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition);
+int spl_load_image_ext(struct blk_desc *block_dev, int partition,
+		       const char *filename);
+int spl_load_image_ext_os(struct blk_desc *block_dev, int partition);
 
 /**
  * spl_init() - Set up device tree and driver model in SPL if enabled
diff --git a/include/systemace.h b/include/systemace.h
index 3f342d5..3b6ec7d 100644
--- a/include/systemace.h
+++ b/include/systemace.h
@@ -11,7 +11,7 @@
 
 # include  <part.h>
 
-block_dev_desc_t *  systemace_get_dev(int dev);
+struct blk_desc *systemace_get_dev(int dev);
 
 #endif	/* CONFIG_SYSTEMACE */
 #endif	/* __SYSTEMACE_H */
diff --git a/include/ubifs_uboot.h b/include/ubifs_uboot.h
index dab433a..d86da27 100644
--- a/include/ubifs_uboot.h
+++ b/include/ubifs_uboot.h
@@ -21,7 +21,7 @@
 int ubifs_is_mounted(void);
 int ubifs_load(char *filename, u32 addr, u32 size);
 
-int ubifs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info);
+int ubifs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info);
 int ubifs_ls(const char *dir_name);
 int ubifs_exists(const char *filename);
 int ubifs_size(const char *filename, loff_t *size);
diff --git a/include/usb.h b/include/usb.h
index 0b410b6..c2fa684 100644
--- a/include/usb.h
+++ b/include/usb.h
@@ -228,7 +228,7 @@
 #ifdef CONFIG_USB_STORAGE
 
 #define USB_MAX_STOR_DEV 7
-block_dev_desc_t *usb_stor_get_dev(int index);
+struct blk_desc *usb_stor_get_dev(int index);
 int usb_stor_scan(int mode);
 int usb_stor_info(void);
 
diff --git a/include/usb_mass_storage.h b/include/usb_mass_storage.h
index 5804b70..8229f62 100644
--- a/include/usb_mass_storage.h
+++ b/include/usb_mass_storage.h
@@ -23,7 +23,7 @@
 	unsigned int start_sector;
 	unsigned int num_sectors;
 	const char *name;
-	block_dev_desc_t block_dev;
+	struct blk_desc block_dev;
 };
 
 int fsg_init(struct ums *ums_devs, int count);
diff --git a/include/zfs_common.h b/include/zfs_common.h
index 3bd575e..bca3dff 100644
--- a/include/zfs_common.h
+++ b/include/zfs_common.h
@@ -63,7 +63,7 @@
 struct zfs_filesystem {
 
 	/* Block Device Descriptor */
-	block_dev_desc_t *dev_desc;
+	struct blk_desc *dev_desc;
 };
 
 struct device_s {
@@ -98,7 +98,7 @@
 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(block_dev_desc_t *rbdd, disk_partition_t *info);
+void zfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info);
 void zfs_unmount(struct zfs_data *data);
 int lzjb_decompress(void *, void *, uint32_t, uint32_t);
 #endif