Skip to contentSkip to conversation

virtio-blk: remove duplicate definition of VirtIOBlock *s pointer

PATCH Applied Stefano Garzarella 3 participants 3 messages Jan 30, 2019

lore
Share & tools
lore
#0 lore raw

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
index f208c6ddb9..9a87b3bfac 100644
@@ -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
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · Stefano Garzarella

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 -0
index f208c6ddb9..9a87b3bfac 100644

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.
#2 lore raw
In reply to Stefano Garzarella
Quoted 15 lines · Stefano Garzarella

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 -0
index f208c6ddb9..9a87b3bfac 100644

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