Create and use async_block() macro; it cuts down on the visual overhead

of blocking on asynchronous operations, when that isn't an important
aspect of the code.
This commit is contained in:
Michael Brown
2007-01-16 08:10:54 +00:00
parent f11da20f25
commit ff8528ea9a
5 changed files with 54 additions and 28 deletions
+3 -6
View File
@@ -17,6 +17,7 @@
*/
#include <stddef.h>
#include <gpxe/async.h>
#include <gpxe/aoe.h>
/** @file
@@ -37,13 +38,9 @@ static int aoe_command ( struct ata_device *ata,
struct aoe_device *aoedev
= container_of ( ata, struct aoe_device, ata );
struct async async;
int rc;
async_init_orphan ( &async );
if ( ( rc = aoe_issue ( &aoedev->aoe, command, &async ) ) != 0 )
return rc;
async_wait ( &async, &rc, 1 );
return rc;
return async_block ( &async, aoe_issue ( &aoedev->aoe, command,
&async ) );
}
/**