Staging: hv: vmbus: Cleanup error values in ringbuffer.c
authorK. Y. Srinivasan <kys@microsoft.com>
Thu, 25 Aug 2011 16:48:58 +0000 (09:48 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 25 Aug 2011 22:23:18 +0000 (15:23 -0700)
Use standard Linux errno values in ringbuffer.c and do the associated
cleanup in the clients.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/hv/blkvsc_drv.c
drivers/staging/hv/netvsc.c
drivers/staging/hv/ring_buffer.c
drivers/staging/hv/storvsc_drv.c

index 07dc9ed6ec55b47102e39c9e36acb020b9469173..2b41eb677b2ff87b740e34df3be900417db829ec 100644 (file)
@@ -725,7 +725,7 @@ static int blkvsc_do_request(struct block_device_context *blkdev,
                } else {
                        ret = blkvsc_submit_request(blkvsc_req,
                                                    blkvsc_request_completion);
-                       if (ret == -1) {
+                       if (ret == -EAGAIN) {
                                pending = 1;
                                list_add_tail(&blkvsc_req->pend_entry,
                                              &blkdev->pending_list);
index cb02eed741f72663d6c17f49f518a86c632ab1c5..d547ff676a0baa07995aa3d81cb493c7352bb7ec 100644 (file)
@@ -565,7 +565,7 @@ retry_send_cmplt:
        if (ret == 0) {
                /* success */
                /* no-op */
-       } else if (ret == -1) {
+       } else if (ret == -EAGAIN) {
                /* no more room...wait a bit and attempt to retry 3 times */
                retries++;
                dev_err(&device->device, "unable to send receive completion pkt"
index 42f76728429a0676dcd0cd3a82d2e10b55ee2fd0..9212699a6632fa1f2f2076b71bad46472a2467d2 100644 (file)
@@ -390,7 +390,7 @@ int hv_ringbuffer_write(struct hv_ring_buffer_info *outring_info,
        /* is empty since the read index == write index */
        if (bytes_avail_towrite <= totalbytes_towrite) {
                spin_unlock_irqrestore(&outring_info->ring_lock, flags);
-               return -1;
+               return -EAGAIN;
        }
 
        /* Write to the ring buffer */
@@ -450,7 +450,7 @@ int hv_ringbuffer_peek(struct hv_ring_buffer_info *Inring_info,
 
                spin_unlock_irqrestore(&Inring_info->ring_lock, flags);
 
-               return -1;
+               return -EAGAIN;
        }
 
        /* Convert to byte offset */
@@ -496,7 +496,7 @@ int hv_ringbuffer_read(struct hv_ring_buffer_info *inring_info, void *buffer,
        if (bytes_avail_toread < buflen) {
                spin_unlock_irqrestore(&inring_info->ring_lock, flags);
 
-               return -1;
+               return -EAGAIN;
        }
 
        next_read_location =
index 0297418e8a6eae5e3a26299c325b83caff469ad8..29ac6440688087c92b94810ebc49936472c2b78c 100644 (file)
@@ -578,7 +578,7 @@ retry_request:
        /* Invokes the vsc to start an IO */
        ret = storvsc_do_io(dev, &cmd_request->request);
 
-       if (ret == -1) {
+       if (ret == -EAGAIN) {
                /* no more space */
 
                if (cmd_request->bounce_sgl_count) {