提交 4277906d 编写于 作者: C Christoph Hellwig 提交者: Anthony Liguori

virtio-blk: remove dead variable in virtio_blk_handle_scsi

As pointed out by clang size is only ever written to, but never actually
used.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 f8012c13
......@@ -165,7 +165,7 @@ static VirtIOBlockReq *virtio_blk_get_request(VirtIOBlock *s)
static void virtio_blk_handle_scsi(VirtIOBlockReq *req)
{
struct sg_io_hdr hdr;
int ret, size = 0;
int ret;
int status;
int i;
......@@ -194,7 +194,6 @@ static void virtio_blk_handle_scsi(VirtIOBlockReq *req)
* before the regular inhdr.
*/
req->scsi = (void *)req->elem.in_sg[req->elem.in_num - 2].iov_base;
size = sizeof(*req->in) + sizeof(*req->scsi);
memset(&hdr, 0, sizeof(struct sg_io_hdr));
hdr.interface_id = 'S';
......@@ -226,7 +225,6 @@ static void virtio_blk_handle_scsi(VirtIOBlockReq *req)
hdr.dxfer_len += req->elem.in_sg[i].iov_len;
hdr.dxferp = req->elem.in_sg;
size += hdr.dxfer_len;
} else {
/*
* Some SCSI commands don't actually transfer any data.
......@@ -236,7 +234,6 @@ static void virtio_blk_handle_scsi(VirtIOBlockReq *req)
hdr.sbp = req->elem.in_sg[req->elem.in_num - 3].iov_base;
hdr.mx_sb_len = req->elem.in_sg[req->elem.in_num - 3].iov_len;
size += hdr.mx_sb_len;
ret = bdrv_ioctl(req->dev->bs, SG_IO, &hdr);
if (ret) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册