virtio-blk: remove duplicate definition of VirtIOBlock *s pointer
PATCH 1/1 virtio-blk: remove duplicate definition of VirtIOBlock *s pointer
VirtIOBlock *s is already defined and initialized with req->dev on top of virtio_blk_handle_request(), so we can remove it from the code block of VIRTIO_BLK_T_GET_ID case.
--- hw/block/virtio-blk.c | 2 -- 1 file changed, 2 deletions(-)
hw/block/virtio-blk.c +0 -2
@@ -569,8 +569,6 @@ static int virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb)break ;case VIRTIO_BLK_T_GET_ID : { -VirtIOBlock *s = req->dev; -/* * NB: per existing s/n string convention the string is * terminated by '\0' only when shorter than buffer.
Signature · 1 line
2.20.1
Quoted 15 lines · Stefano Garzarella
VirtIOBlock *s is already defined and initialized with
req->devon top ofvirtio_blk_handle_request(), so we can remove it from the code block ofVIRTIO_BLK_T_GET_IDcase.Signed-off-by Stefano Garzarella <[email protected]>--- hw/block/virtio-blk.c | 2 -- 1 file changed, 2 deletions(-)hw/block/virtio-blk.c +0
-0
hw/block/virtio-blk.c static int virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb) · line 574
Quoted 8 lines
hw/block/virtio-blk.c +0
-2@@ -569,8 +569,6 @@ static int virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb)break ;case VIRTIO_BLK_T_GET_ID : { -VirtIOBlock *s = req->dev; -/* * NB: per existing s/n string convention the string is * terminated by '\0' only when shorter than buffer.
Laurent Vivier
AppliedQuoted 15 lines · Stefano Garzarella
VirtIOBlock *s is already defined and initialized with
req->devon top ofvirtio_blk_handle_request(), so we can remove it from the code block ofVIRTIO_BLK_T_GET_IDcase.Signed-off-by Stefano Garzarella <[email protected]>--- hw/block/virtio-blk.c | 2 -- 1 file changed, 2 deletions(-)hw/block/virtio-blk.c +0
-0
hw/block/virtio-blk.c static int virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb) · line 574
Quoted 8 lines
hw/block/virtio-blk.c +0
-2@@ -569,8 +569,6 @@ static int virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb)break ;case VIRTIO_BLK_T_GET_ID : { -VirtIOBlock *s = req->dev; -/* * NB: per existing s/n string convention the string is * terminated by '\0' only when shorter than buffer.
Applied to my trivial-patches branch.
Thanks,
Laurent