From: FUJITA Tomonori Date: Tue, 25 Mar 2008 00:26:50 +0000 (+0900) Subject: [SCSI] scsi_debug: use scsi_build_sense_buffer X-Git-Tag: Ubuntu-5.4-5.4.0-11.14~37842^2~86 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=a34c4e98367965402134f2e66c3cdc4416f109e4;p=mirror_ubuntu-focal-kernel.git [SCSI] scsi_debug: use scsi_build_sense_buffer Signed-off-by: FUJITA Tomonori Cc: Douglas Gilbert Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 4f4c5b7bdef5..5f348e7b1184 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -46,6 +46,7 @@ #include #include #include +#include #include @@ -1808,22 +1809,13 @@ static struct sdebug_dev_info * devInfoReg(struct scsi_device * sdev) static void mk_sense_buffer(struct sdebug_dev_info * devip, int key, int asc, int asq) { - unsigned char * sbuff; + unsigned char *sbuff; sbuff = devip->sense_buff; memset(sbuff, 0, SDEBUG_SENSE_LEN); - if (scsi_debug_dsense) { - sbuff[0] = 0x72; /* descriptor, current */ - sbuff[1] = key; - sbuff[2] = asc; - sbuff[3] = asq; - } else { - sbuff[0] = 0x70; /* fixed, current */ - sbuff[2] = key; - sbuff[7] = 0xa; /* implies 18 byte sense buffer */ - sbuff[12] = asc; - sbuff[13] = asq; - } + + scsi_build_sense_buffer(scsi_debug_dsense, sbuff, key, asc, asq); + if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) printk(KERN_INFO "scsi_debug: [sense_key,asc,ascq]: " "[0x%x,0x%x,0x%x]\n", key, asc, asq);