summaryrefslogtreecommitdiff
path: root/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2013-08-17 12:18:22 -0400
committerMichael Sevakis <jethead71@rockbox.org>2013-08-17 12:18:22 -0400
commita56f1ca1ed63b93eb61fd5319f47347b3eb1e364 (patch)
tree62a253ba44b23c1867cef59fee40b40092719ee1 /firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c
parentc13f21a4d5c27c638c9f0dedf6d7b1f9bbb4d682 (diff)
downloadrockbox-a56f1ca1ed63b93eb61fd5319f47347b3eb1e364.tar.gz
rockbox-a56f1ca1ed63b93eb61fd5319f47347b3eb1e364.zip
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
Diffstat (limited to 'firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c')
-rw-r--r--firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c
index 4ff39e2a9e..f13904628d 100644
--- a/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c
+++ b/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c
@@ -126,8 +126,8 @@ void GIO2(void)
126 126
127#define VFAT_SECTOR_SIZE(x) ( (x)/0x8000 ) /* 1GB array requires 80kB of RAM */ 127#define VFAT_SECTOR_SIZE(x) ( (x)/0x8000 ) /* 1GB array requires 80kB of RAM */
128 128
129extern int ata_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* buf); 129extern int ata_read_sectors(IF_MD(int drive,) unsigned long start, int count, void* buf);
130extern int ata_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const void* buf); 130extern int ata_write_sectors(IF_MD(int drive,) unsigned long start, int count, const void* buf);
131 131
132struct main_header 132struct main_header
133{ 133{
@@ -396,14 +396,14 @@ static inline unsigned long map_sector(unsigned long sector)
396 return cfs_start+sectors[sector/64]*64+sector%64; 396 return cfs_start+sectors[sector/64]*64+sector%64;
397} 397}
398 398
399int ata_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* buf) 399int ata_read_sectors(IF_MD(int drive,) unsigned long start, int count, void* buf)
400{ 400{
401 if(!cfs_inited) 401 if(!cfs_inited)
402 cfs_init(); 402 cfs_init();
403 403
404 /* Check if count is lesser than or equal to 1 native CFS sector */ 404 /* Check if count is lesser than or equal to 1 native CFS sector */
405 if(count <= 64) 405 if(count <= 64)
406 return _ata_read_sectors(IF_MD2(drive,) map_sector(start), count, buf); 406 return _ata_read_sectors(IF_MD(drive,) map_sector(start), count, buf);
407 else 407 else
408 { 408 {
409 int i; 409 int i;
@@ -412,7 +412,7 @@ int ata_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* bu
412 /* Read sectors in parts of 0x8000 */ 412 /* Read sectors in parts of 0x8000 */
413 for(i=0; i<count; i+=64) 413 for(i=0; i<count; i+=64)
414 { 414 {
415 int ret = _ata_read_sectors(IF_MD2(drive,) map_sector(start+i), (count-i >= 64 ? 64 : count-i), (void*)dest); 415 int ret = _ata_read_sectors(IF_MD(drive,) map_sector(start+i), (count-i >= 64 ? 64 : count-i), (void*)dest);
416 if(ret != 0) 416 if(ret != 0)
417 return ret; 417 return ret;
418 418
@@ -423,7 +423,7 @@ int ata_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* bu
423 } 423 }
424} 424}
425 425
426int ata_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const void* buf) 426int ata_write_sectors(IF_MD(int drive,) unsigned long start, int count, const void* buf)
427{ 427{
428 if(!cfs_inited) 428 if(!cfs_inited)
429 cfs_init(); 429 cfs_init();
@@ -431,7 +431,7 @@ int ata_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const v
431#if 0 /* Disabled for now */ 431#if 0 /* Disabled for now */
432 /* Check if count is lesser than or equal to 1 native CFS sector */ 432 /* Check if count is lesser than or equal to 1 native CFS sector */
433 if(count <= 64) 433 if(count <= 64)
434 return _ata_write_sectors(IF_MD2(drive,) map_sector(start), count, buf); 434 return _ata_write_sectors(IF_MD(drive,) map_sector(start), count, buf);
435 else 435 else
436 { 436 {
437 int i, ret; 437 int i, ret;
@@ -440,7 +440,7 @@ int ata_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const v
440 /* Read sectors in parts of 0x8000 */ 440 /* Read sectors in parts of 0x8000 */
441 for(i=0; i<count; i+=64) 441 for(i=0; i<count; i+=64)
442 { 442 {
443 ret = _ata_write_sectors(IF_MD2(drive,) map_sector(start+i), (count-i >= 64 ? 64 : count-i), (const void*)dest); 443 ret = _ata_write_sectors(IF_MD(drive,) map_sector(start+i), (count-i >= 64 ? 64 : count-i), (const void*)dest);
444 if(ret != 0) 444 if(ret != 0)
445 return ret; 445 return ret;
446 446