dm: part: Add a cast to avoid a compiler warning
[platform/kernel/u-boot.git] / disk / part_dos.c
index 6280660..ea0315c 100644 (file)
@@ -87,11 +87,11 @@ static int test_block_type(unsigned char *buffer)
 }
 
 
-int test_part_dos (block_dev_desc_t *dev_desc)
+int test_part_dos(struct blk_desc *dev_desc)
 {
        ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
 
-       if (dev_desc->block_read(dev_desc->dev, 0, 1, (ulong *) buffer) != 1)
+       if (dev_desc->block_read(dev_desc, 0, 1, (ulong *)buffer) != 1)
                return -1;
 
        if (test_block_type(buffer) != DOS_MBR)
@@ -102,7 +102,7 @@ int test_part_dos (block_dev_desc_t *dev_desc)
 
 /*  Print a partition that is relative to its Extended partition table
  */
-static void print_partition_extended(block_dev_desc_t *dev_desc,
+static void print_partition_extended(struct blk_desc *dev_desc,
                                     lbaint_t ext_part_sector,
                                     lbaint_t relative,
                                     int part_num, unsigned int disksig)
@@ -111,7 +111,8 @@ static void print_partition_extended(block_dev_desc_t *dev_desc,
        dos_partition_t *pt;
        int i;
 
-       if (dev_desc->block_read(dev_desc->dev, ext_part_sector, 1, (ulong *) buffer) != 1) {
+       if (dev_desc->block_read(dev_desc, ext_part_sector, 1,
+                                (ulong *)buffer) != 1) {
                printf ("** Can't read partition table on %d:" LBAFU " **\n",
                        dev_desc->dev, ext_part_sector);
                return;
@@ -166,18 +167,19 @@ static void print_partition_extended(block_dev_desc_t *dev_desc,
 
 /*  Print a partition that is relative to its Extended partition table
  */
-static int get_partition_info_extended (block_dev_desc_t *dev_desc,
-                                lbaint_t ext_part_sector,
-                                lbaint_t relative, int part_num,
-                                int which_part, disk_partition_t *info,
-                                unsigned int disksig)
+static int get_partition_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)
 {
        ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
        dos_partition_t *pt;
        int i;
        int dos_type;
 
-       if (dev_desc->block_read (dev_desc->dev, ext_part_sector, 1, (ulong *) buffer) != 1) {
+       if (dev_desc->block_read(dev_desc, ext_part_sector, 1,
+                                (ulong *)buffer) != 1) {
                printf ("** Can't read partition table on %d:" LBAFU " **\n",
                        dev_desc->dev, ext_part_sector);
                return -1;
@@ -235,7 +237,7 @@ static int get_partition_info_extended (block_dev_desc_t *dev_desc,
                                        break;
                        }
                        /* sprintf(info->type, "%d, pt->sys_ind); */
-                       sprintf ((char *)info->type, "U-Boot");
+                       strcpy((char *)info->type, "U-Boot");
                        info->bootable = is_bootable(pt);
 #ifdef CONFIG_PARTITION_UUIDS
                        sprintf(info->uuid, "%08x-%02x", disksig, part_num);
@@ -271,7 +273,7 @@ static int get_partition_info_extended (block_dev_desc_t *dev_desc,
                info->size = dev_desc->lba;
                info->blksz = DOS_PART_DEFAULT_SECTOR;
                info->bootable = 0;
-               sprintf ((char *)info->type, "U-Boot");
+               strcpy((char *)info->type, "U-Boot");
 #ifdef CONFIG_PARTITION_UUIDS
                info->uuid[0] = 0;
 #endif
@@ -281,13 +283,14 @@ static int get_partition_info_extended (block_dev_desc_t *dev_desc,
        return -1;
 }
 
-void print_part_dos (block_dev_desc_t *dev_desc)
+void print_part_dos(struct blk_desc *dev_desc)
 {
        printf("Part\tStart Sector\tNum Sectors\tUUID\t\tType\n");
        print_partition_extended(dev_desc, 0, 0, 1, 0);
 }
 
-int get_partition_info_dos (block_dev_desc_t *dev_desc, int part, disk_partition_t * info)
+int get_partition_info_dos(struct blk_desc *dev_desc, int part,
+                          disk_partition_t *info)
 {
        return get_partition_info_extended(dev_desc, 0, 0, 1, part, info, 0);
 }