Core: code clean: cuts the unnecessary data type conversion in disk read-write function
authorLiu Aleaxander <Aleaxander@gmail.com>
Tue, 7 Jul 2009 16:59:03 +0000 (00:59 +0800)
committerLiu Aleaxander <Aleaxander@gmail.com>
Tue, 7 Jul 2009 16:59:03 +0000 (00:59 +0800)
It's unnecessary to do that conversion.

core/ext2.c
core/fat.c
core/iso9660.c

index a0bd2af..d808acd 100644 (file)
@@ -757,7 +757,7 @@ int ext2_fs_init(struct fs_info *fs)
     printf("super block@: %p\n", &sb);
 #endif
     /* read the super block */
-    disk->rdwr_sectors(disk, (void *)&sb, 2, 2, 0);
+    disk->rdwr_sectors(disk, &sb, 2, 2, 0);
     
     ClustByteShift = sb.s_log_block_size + 10;
     ClustSize = 1 << ClustByteShift;
index f8d9f6d..ce804bf 100644 (file)
@@ -298,7 +298,7 @@ static void __getfssec(struct fs_info *fs, char *buf, struct open_file_t *file,
 #endif  
                         
         /* do read */
-        disk->rdwr_sectors(disk, (void *)buf, frag_start, con_sec_cnt, 0);
+        disk->rdwr_sectors(disk, buf, frag_start, con_sec_cnt, 0);
         buf += con_sec_cnt << 9;/* adjust buffer pointer */
         
         if ( !sectors )
@@ -910,7 +910,7 @@ int vfat_fs_init(struct fs_info *fs)
     struct disk *disk = fs->fs_dev->disk;
     
     /* get the fat bpb information */
-    disk->rdwr_sectors(disk, (void *)&fat, 0, 1, 0);
+    disk->rdwr_sectors(disk, &fat, 0, 1, 0);
     
     TotalSectors = fat.bxSectors ? : fat.bsHugeSectors;
     FAT = fat.bxResSectors;
index e696c84..0a0ae19 100644 (file)
@@ -258,7 +258,7 @@ uint32_t iso_getfssec(struct fs_info *fs, char *buf,
     if ( sectors > file->file_left )
         sectors = file->file_left;
     
-    disk->rdwr_sectors(disk, (void *)buf, file->file_sector, sectors, 0);
+    disk->rdwr_sectors(disk, buf, file->file_sector, sectors, 0);
     
     file->file_sector += sectors;
     file->file_left   -= sectors;
@@ -516,7 +516,7 @@ int iso_fs_init(struct fs_info *fs)
     struct open_file_t *open_file;
     struct disk *disk = fs->fs_dev->disk;
     
-    disk->rdwr_sectors(disk, (void*)trackbuf, bi_pvd, 1, 0);
+    disk->rdwr_sectors(disk, trackbuf, bi_pvd, 1, 0);
     
     CurrentDir.dir_lba = RootDir.dir_lba = *(uint32_t *)(trackbuf + 156 + 2);