forked from len0rd/rockbox
Cleanup MV/MD macros a little.
When using variadic macros there's no need for IF_MD2/IF_MV2 to deal with function parameters. IF_MD/IF_MV are enough. Throw in IF_MD_DRV/ID_MV_VOL that return the parameter if MD/MV, or 0 if not. Change-Id: I7605e6039f3be19cb47110c84dcb3c5516f2c3eb
This commit is contained in:
parent
c13f21a4d5
commit
a56f1ca1ed
44 changed files with 219 additions and 218 deletions
|
|
@ -83,7 +83,7 @@ static void storage_wait_turn(IF_MD_NONVOID(int drive))
|
|||
}
|
||||
#endif
|
||||
|
||||
int storage_read_sectors(IF_MD2(int drive,) unsigned long start, int count,
|
||||
int storage_read_sectors(IF_MD(int drive,) unsigned long start, int count,
|
||||
void* buf)
|
||||
{
|
||||
#ifdef HAVE_IO_PRIORITY
|
||||
|
|
@ -98,38 +98,38 @@ int storage_read_sectors(IF_MD2(int drive,) unsigned long start, int count,
|
|||
{
|
||||
#if (CONFIG_STORAGE & STORAGE_ATA)
|
||||
case STORAGE_ATA:
|
||||
return ata_read_sectors(IF_MD2(ldrive,) start,count,buf);
|
||||
return ata_read_sectors(IF_MD(ldrive,) start,count,buf);
|
||||
#endif
|
||||
|
||||
#if (CONFIG_STORAGE & STORAGE_MMC)
|
||||
case STORAGE_MMC:
|
||||
return mmc_read_sectors(IF_MD2(ldrive,) start,count,buf);
|
||||
return mmc_read_sectors(IF_MD(ldrive,) start,count,buf);
|
||||
#endif
|
||||
|
||||
#if (CONFIG_STORAGE & STORAGE_SD)
|
||||
case STORAGE_SD:
|
||||
return sd_read_sectors(IF_MD2(ldrive,) start,count,buf);
|
||||
return sd_read_sectors(IF_MD(ldrive,) start,count,buf);
|
||||
#endif
|
||||
|
||||
#if (CONFIG_STORAGE & STORAGE_NAND)
|
||||
case STORAGE_NAND:
|
||||
return nand_read_sectors(IF_MD2(ldrive,) start,count,buf);
|
||||
return nand_read_sectors(IF_MD(ldrive,) start,count,buf);
|
||||
#endif
|
||||
|
||||
#if (CONFIG_STORAGE & STORAGE_RAMDISK)
|
||||
case STORAGE_RAMDISK:
|
||||
return ramdisk_read_sectors(IF_MD2(ldrive,) start,count,buf);
|
||||
return ramdisk_read_sectors(IF_MD(ldrive,) start,count,buf);
|
||||
#endif
|
||||
}
|
||||
|
||||
return -1;
|
||||
#else /* CONFIG_STORAGE_MULTI */
|
||||
return STORAGE_FUNCTION(read_sectors)(IF_MD2(drive,)start,count,buf);
|
||||
return STORAGE_FUNCTION(read_sectors)(IF_MD(drive,)start,count,buf);
|
||||
#endif /* CONFIG_STORAGE_MULTI */
|
||||
|
||||
}
|
||||
|
||||
int storage_write_sectors(IF_MD2(int drive,) unsigned long start, int count,
|
||||
int storage_write_sectors(IF_MD(int drive,) unsigned long start, int count,
|
||||
const void* buf)
|
||||
{
|
||||
#ifdef HAVE_IO_PRIORITY
|
||||
|
|
@ -144,33 +144,33 @@ int storage_write_sectors(IF_MD2(int drive,) unsigned long start, int count,
|
|||
{
|
||||
#if (CONFIG_STORAGE & STORAGE_ATA)
|
||||
case STORAGE_ATA:
|
||||
return ata_write_sectors(IF_MD2(ldrive,)start,count,buf);
|
||||
return ata_write_sectors(IF_MD(ldrive,)start,count,buf);
|
||||
#endif
|
||||
|
||||
#if (CONFIG_STORAGE & STORAGE_MMC)
|
||||
case STORAGE_MMC:
|
||||
return mmc_write_sectors(IF_MD2(ldrive,)start,count,buf);
|
||||
return mmc_write_sectors(IF_MD(ldrive,)start,count,buf);
|
||||
#endif
|
||||
|
||||
#if (CONFIG_STORAGE & STORAGE_SD)
|
||||
case STORAGE_SD:
|
||||
return sd_write_sectors(IF_MD2(ldrive,)start,count,buf);
|
||||
return sd_write_sectors(IF_MD(ldrive,)start,count,buf);
|
||||
#endif
|
||||
|
||||
#if (CONFIG_STORAGE & STORAGE_NAND)
|
||||
case STORAGE_NAND:
|
||||
return nand_write_sectors(IF_MD2(ldrive,)start,count,buf);
|
||||
return nand_write_sectors(IF_MD(ldrive,)start,count,buf);
|
||||
#endif
|
||||
|
||||
#if (CONFIG_STORAGE & STORAGE_RAMDISK)
|
||||
case STORAGE_RAMDISK:
|
||||
return ramdisk_write_sectors(IF_MD2(ldrive,)start,count,buf);
|
||||
return ramdisk_write_sectors(IF_MD(ldrive,)start,count,buf);
|
||||
#endif
|
||||
}
|
||||
|
||||
return -1;
|
||||
#else /* CONFIG_STORAGE_MULTI */
|
||||
return STORAGE_FUNCTION(write_sectors)(IF_MD2(drive,)start,count,buf);
|
||||
return STORAGE_FUNCTION(write_sectors)(IF_MD(drive,)start,count,buf);
|
||||
#endif /* CONFIG_STORAGE_MULTI */
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue