diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2013-08-17 12:18:22 -0400 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2013-08-17 12:18:22 -0400 |
commit | a56f1ca1ed63b93eb61fd5319f47347b3eb1e364 (patch) | |
tree | 62a253ba44b23c1867cef59fee40b40092719ee1 /firmware/usbstack | |
parent | c13f21a4d5c27c638c9f0dedf6d7b1f9bbb4d682 (diff) |
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/usbstack')
-rw-r--r-- | firmware/usbstack/usb_storage.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/firmware/usbstack/usb_storage.c b/firmware/usbstack/usb_storage.c index b898978776..d1279d0ee1 100644 --- a/firmware/usbstack/usb_storage.c +++ b/firmware/usbstack/usb_storage.c @@ -353,7 +353,7 @@ static bool check_disk_present(IF_MD_NONVOID(int volume)) return true; #else unsigned char* sector = fat_get_sector_buffer(); - bool success = storage_read_sectors(IF_MD2(volume,)0,1,sector) == 0; + bool success = storage_read_sectors(IF_MD(volume,)0,1,sector) == 0; fat_release_sector_buffer(); return success; #endif @@ -526,7 +526,7 @@ void usb_storage_transfer_complete(int ep,int dir,int status,int length) int result = USBSTOR_WRITE_SECTORS_FILTER(); if (result == 0) { - result = storage_write_sectors(IF_MD2(cur_cmd.lun,) + result = storage_write_sectors(IF_MD(cur_cmd.lun,) cur_cmd.sector, MIN(WRITE_BUFFER_SIZE/SECTOR_SIZE, cur_cmd.count), cur_cmd.data[cur_cmd.data_select]); @@ -728,7 +728,7 @@ static void send_and_read_next(void) ramdisk_buffer + cur_cmd.sector*SECTOR_SIZE, MIN(READ_BUFFER_SIZE/SECTOR_SIZE, cur_cmd.count)*SECTOR_SIZE); #else - result = storage_read_sectors(IF_MD2(cur_cmd.lun,) + result = storage_read_sectors(IF_MD(cur_cmd.lun,) cur_cmd.sector, MIN(READ_BUFFER_SIZE/SECTOR_SIZE, cur_cmd.count), cur_cmd.data[cur_cmd.data_select]); @@ -1087,7 +1087,7 @@ static void handle_scsi(struct command_block_wrapper* cbw) ramdisk_buffer + cur_cmd.sector*SECTOR_SIZE, MIN(READ_BUFFER_SIZE/SECTOR_SIZE,cur_cmd.count)*SECTOR_SIZE); #else - cur_cmd.last_result = storage_read_sectors(IF_MD2(cur_cmd.lun,) + cur_cmd.last_result = storage_read_sectors(IF_MD(cur_cmd.lun,) cur_cmd.sector, MIN(READ_BUFFER_SIZE/SECTOR_SIZE, cur_cmd.count), cur_cmd.data[cur_cmd.data_select]); |