]> Git Repo - qemu.git/commitdiff
scsi: make write_data return void
authorPaolo Bonzini <[email protected]>
Fri, 22 Apr 2011 07:39:16 +0000 (09:39 +0200)
committerPaolo Bonzini <[email protected]>
Thu, 26 May 2011 10:14:17 +0000 (12:14 +0200)
The return value is unused anyway.

Signed-off-by: Paolo Bonzini <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
hw/scsi-disk.c
hw/scsi-generic.c
hw/scsi.h

index f3eba528504ab8a7798adb45321e17b919d30a24..e0c384f148534ed206e0bea0f9c8355c950b8978 100644 (file)
@@ -269,7 +269,7 @@ static void scsi_write_complete(void * opaque, int ret)
     }
 }
 
-static int scsi_write_data(SCSIRequest *req)
+static void scsi_write_data(SCSIRequest *req)
 {
     SCSIDiskReq *r = DO_UPCAST(SCSIDiskReq, req, req);
     SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev);
@@ -281,7 +281,7 @@ static int scsi_write_data(SCSIRequest *req)
     if (r->req.cmd.mode != SCSI_XFER_TO_DEV) {
         DPRINTF("Data transfer direction invalid\n");
         scsi_write_complete(r, -EINVAL);
-        return 0;
+        return;
     }
 
     n = r->iov.iov_len / 512;
@@ -296,8 +296,6 @@ static int scsi_write_data(SCSIRequest *req)
         /* Invoke completion routine to fetch data from host.  */
         scsi_write_complete(r, 0);
     }
-
-    return 0;
 }
 
 static void scsi_dma_restart_bh(void *opaque)
index fc015e07557d178d6856ae327e3277a8f9a7e378..579bab9e7cb2c513d2cbd983863d03dd946d1532 100644 (file)
@@ -277,7 +277,7 @@ static void scsi_write_complete(void * opaque, int ret)
 
 /* Write data to a scsi device.  Returns nonzero on failure.
    The transfer may complete asynchronously.  */
-static int scsi_write_data(SCSIRequest *req)
+static void scsi_write_data(SCSIRequest *req)
 {
     SCSIGenericState *s = DO_UPCAST(SCSIGenericState, qdev, req->dev);
     SCSIGenericReq *r = DO_UPCAST(SCSIGenericReq, req, req);
@@ -287,16 +287,13 @@ static int scsi_write_data(SCSIRequest *req)
     if (r->len == 0) {
         r->len = r->buflen;
         scsi_req_data(&r->req, r->len);
-        return 0;
+        return;
     }
 
     ret = execute_command(s->bs, r, SG_DXFER_TO_DEV, scsi_write_complete);
     if (ret < 0) {
         scsi_command_complete(r, ret);
-        return 1;
     }
-
-    return 0;
 }
 
 /* Return a pointer to the data buffer.  */
index 5730faa55386b3577cf58abaafacfc372fbe5d1f..b56338d72a1d66aef9106446238862a42208c307 100644 (file)
--- a/hw/scsi.h
+++ b/hw/scsi.h
@@ -77,7 +77,7 @@ struct SCSIDeviceInfo {
     void (*free_req)(SCSIRequest *req);
     int32_t (*send_command)(SCSIRequest *req, uint8_t *buf);
     void (*read_data)(SCSIRequest *req);
-    int (*write_data)(SCSIRequest *req);
+    void (*write_data)(SCSIRequest *req);
     void (*cancel_io)(SCSIRequest *req);
     uint8_t *(*get_buf)(SCSIRequest *req);
     int (*get_sense)(SCSIRequest *req, uint8_t *buf, int len);
This page took 0.041081 seconds and 4 git commands to generate.