]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
virtio_blk: add default case to cmd type switch
authorJens Axboe <jaxboe@fusionio.com>
Fri, 18 Jun 2010 10:10:18 +0000 (12:10 +0200)
committerJens Axboe <jaxboe@fusionio.com>
Sat, 7 Aug 2010 16:22:26 +0000 (18:22 +0200)
On compilation, gcc correctly detects that we do not handle
all types:

In function ‘blk_done’:
warning: enumeration value ‘REQ_TYPE_FS’ not handled in switch
warning: enumeration value ‘REQ_TYPE_SENSE’ not handled in switch
warning: enumeration value ‘REQ_TYPE_PM_SUSPEND’ not handled in switch
warning: enumeration value ‘REQ_TYPE_PM_RESUME’ not handled in switch
warning: enumeration value ‘REQ_TYPE_PM_SHUTDOWN’ not handled in switch
warning: enumeration value ‘REQ_TYPE_LINUX_BLOCK’ not handled in switch
warning: enumeration value ‘REQ_TYPE_ATA_TASKFILE’ not handled in switch
warning: enumeration value ‘REQ_TYPE_ATA_PC’ not handled in switch

which is a bit pointless since this is at the end of the request
processessing. Add a default case that just breaks out.

Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
drivers/block/virtio_blk.c

index 774144334ecee736a531d406a183397c35424c2a..b5ebcd33bdb61dea6619577e1abc66d660102c43 100644 (file)
@@ -74,6 +74,8 @@ static void blk_done(struct virtqueue *vq)
                case REQ_TYPE_SPECIAL:
                        vbr->req->errors = (error != 0);
                        break;
+               default:
+                       break;
                }
 
                __blk_end_request_all(vbr->req, error);