From a56f1ca1ed63b93eb61fd5319f47347b3eb1e364 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Sat, 17 Aug 2013 12:18:22 -0400 Subject: 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 --- firmware/target/arm/as3525/sd-as3525.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'firmware/target/arm/as3525/sd-as3525.c') diff --git a/firmware/target/arm/as3525/sd-as3525.c b/firmware/target/arm/as3525/sd-as3525.c index 5bed36e51e..c80c7f7491 100644 --- a/firmware/target/arm/as3525/sd-as3525.c +++ b/firmware/target/arm/as3525/sd-as3525.c @@ -693,7 +693,7 @@ static int sd_select_bank(signed char bank) return 0; } -static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start, +static int sd_transfer_sectors(IF_MD(int drive,) unsigned long start, int count, void* buf, const bool write) { #ifndef HAVE_MULTIDRIVE @@ -887,19 +887,19 @@ sd_transfer_error_nodma: return ret; } -int sd_read_sectors(IF_MD2(int drive,) unsigned long start, int count, +int sd_read_sectors(IF_MD(int drive,) unsigned long start, int count, void* buf) { int ret; mutex_lock(&sd_mtx); - ret = sd_transfer_sectors(IF_MD2(drive,) start, count, buf, false); + ret = sd_transfer_sectors(IF_MD(drive,) start, count, buf, false); mutex_unlock(&sd_mtx); return ret; } -int sd_write_sectors(IF_MD2(int drive,) unsigned long start, int count, +int sd_write_sectors(IF_MD(int drive,) unsigned long start, int count, const void* buf) { #ifdef VERIFY_WRITE @@ -911,7 +911,7 @@ int sd_write_sectors(IF_MD2(int drive,) unsigned long start, int count, mutex_lock(&sd_mtx); - ret = sd_transfer_sectors(IF_MD2(drive,) start, count, (void*)buf, true); + ret = sd_transfer_sectors(IF_MD(drive,) start, count, (void*)buf, true); #ifdef VERIFY_WRITE if (ret) { @@ -928,10 +928,10 @@ int sd_write_sectors(IF_MD2(int drive,) unsigned long start, int count, if(transfer > UNALIGNED_NUM_SECTORS) transfer = UNALIGNED_NUM_SECTORS; - sd_transfer_sectors(IF_MD2(drive,) start, transfer, aligned_buffer, false); + sd_transfer_sectors(IF_MD(drive,) start, transfer, aligned_buffer, false); if (memcmp(buf, aligned_buffer, transfer * 512) != 0) { /* try the write again in the hope to repair the damage */ - sd_transfer_sectors(IF_MD2(drive,) saved_start, saved_count, saved_buf, true); + sd_transfer_sectors(IF_MD(drive,) saved_start, saved_count, saved_buf, true); panicf("sd: verify failed: sec=%ld n=%d!", start, transfer); } -- cgit v1.2.3