Skip to contentSkip to conversation

drivers, block: virtio_blk: Replace cryptic number with the macro

PATCH Applied Liu Yuan 2 participants 2 messages Apr 23, 2011 – Apr 27, 2011

Subsystems (3)
lore
Share & tools
lore

Liu Yuan

author
#0 lore raw

PATCH 1/1 drivers, block: virtio_blk: Replace cryptic number with the macro

From: Liu Yuan <[email protected]>

It is easier to figure out the context by reading SCSI_SENSE_BUFFERSIZE instead of plain '96'.

---
 drivers/block/virtio_blk.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/block/virtio_blk.c +2 -1
index 6ecf89c..d6a426a 100644
@@ -6,6 +6,7 @@
 #include <linux/virtio.h>
 #include <linux/virtio_blk.h>
 #include <linux/scatterlist.h>
+#include <scsi/scsi_cmnd.h>
 
 #define PART_BITS 4
 
@@ -141,7 +142,7 @@ static bool do_req(struct request_queue *q, struct virtio_blk *vblk,
 	num = blk_rq_map_sg(q, vbr->req, vblk->sg + out);
 
 	if (vbr->req->cmd_type == REQ_TYPE_BLOCK_PC) {
-		sg_set_buf(&vblk->sg[num + out + in++], vbr->req->sense, 96);
+		sg_set_buf(&vblk->sg[num + out + in++], vbr->req->sense, SCSI_SENSE_BUFFERSIZE);
 		sg_set_buf(&vblk->sg[num + out + in++], &vbr->in_hdr,
 			   sizeof(vbr->in_hdr));
 	}
Signature · 1 line
1.7.1