Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a34c4e98 authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by James Bottomley
Browse files

[SCSI] scsi_debug: use scsi_build_sense_buffer



Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Douglas Gilbert <dougg@torque.net>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 3bc6a261
Loading
Loading
Loading
Loading
+5 −13
Original line number Original line Diff line number Diff line
@@ -46,6 +46,7 @@
#include <scsi/scsi_device.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_host.h>
#include <scsi/scsicam.h>
#include <scsi/scsicam.h>
#include <scsi/scsi_eh.h>


#include <linux/stat.h>
#include <linux/stat.h>


@@ -1812,18 +1813,9 @@ static void mk_sense_buffer(struct sdebug_dev_info * devip, int key,


	sbuff = devip->sense_buff;
	sbuff = devip->sense_buff;
	memset(sbuff, 0, SDEBUG_SENSE_LEN);
	memset(sbuff, 0, SDEBUG_SENSE_LEN);
	if (scsi_debug_dsense) {

		sbuff[0] = 0x72;  /* descriptor, current */
	scsi_build_sense_buffer(scsi_debug_dsense, sbuff, key, asc, asq);
		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;
	}
	if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
	if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
		printk(KERN_INFO "scsi_debug:    [sense_key,asc,ascq]: "
		printk(KERN_INFO "scsi_debug:    [sense_key,asc,ascq]: "
		      "[0x%x,0x%x,0x%x]\n", key, asc, asq);
		      "[0x%x,0x%x,0x%x]\n", key, asc, asq);