Commit a0c0b0e9 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Tejun Heo

libata: don't call ata_scsi_rbuf_fill for command without a response buffer

No need to copy a zeroed buffer to the caller if the command is defined
to not have a response in the SCSI spec.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 8fc6c065
...@@ -2452,23 +2452,6 @@ static unsigned int ata_scsiop_inq_b6(struct ata_scsi_args *args, u8 *rbuf) ...@@ -2452,23 +2452,6 @@ static unsigned int ata_scsiop_inq_b6(struct ata_scsi_args *args, u8 *rbuf)
return 0; return 0;
} }
/**
* ata_scsiop_noop - Command handler that simply returns success.
* @args: device IDENTIFY data / SCSI command of interest.
* @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
*
* No operation. Simply returns success to caller, to indicate
* that the caller should successfully complete this SCSI command.
*
* LOCKING:
* spin_lock_irqsave(host lock)
*/
static unsigned int ata_scsiop_noop(struct ata_scsi_args *args, u8 *rbuf)
{
VPRINTK("ENTER\n");
return 0;
}
/** /**
* modecpy - Prepare response for MODE SENSE * modecpy - Prepare response for MODE SENSE
* @dest: output buffer * @dest: output buffer
...@@ -4425,14 +4408,11 @@ void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd) ...@@ -4425,14 +4408,11 @@ void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd)
case SEEK_6: case SEEK_6:
case SEEK_10: case SEEK_10:
case TEST_UNIT_READY: case TEST_UNIT_READY:
ata_scsi_rbuf_fill(&args, ata_scsiop_noop);
break; break;
case SEND_DIAGNOSTIC: case SEND_DIAGNOSTIC:
tmp8 = scsicmd[1] & ~(1 << 3); tmp8 = scsicmd[1] & ~(1 << 3);
if ((tmp8 == 0x4) && (!scsicmd[3]) && (!scsicmd[4])) if (tmp8 != 0x4 || scsicmd[3] || scsicmd[4])
ata_scsi_rbuf_fill(&args, ata_scsiop_noop);
else
ata_scsi_set_invalid_field(dev, cmd, 1, 0xff); ata_scsi_set_invalid_field(dev, cmd, 1, 0xff);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment