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

Commit 7410d849 authored by Boaz Harrosh's avatar Boaz Harrosh Committed by James Bottomley
Browse files

[SCSI] eata_pio: convert to accessors and !use_sg cleanup



 - convert to accessors and !use_sg cleanup

Signed-off-by: default avatarBoaz Harrosh <bharrosh@panasas.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 040cd232
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -385,7 +385,7 @@ static int eata_pio_queue(struct scsi_cmnd *cmd,
		cp->DataIn = 0;	/* Input mode  */

	cp->Interpret = (cmd->device->id == hd->hostid);
	cp->cp_datalen = cpu_to_be32(cmd->request_bufflen);
	cp->cp_datalen = cpu_to_be32(scsi_bufflen(cmd));
	cp->Auto_Req_Sen = 0;
	cp->cp_reqDMA = 0;
	cp->reqlen = 0;
@@ -402,14 +402,14 @@ static int eata_pio_queue(struct scsi_cmnd *cmd,
	cp->cmd = cmd;
	cmd->host_scribble = (char *) &hd->ccb[y];

	if (cmd->use_sg == 0) {
	if (!scsi_bufflen(cmd)) {
		cmd->SCp.buffers_residual = 1;
		cmd->SCp.ptr = cmd->request_buffer;
		cmd->SCp.this_residual = cmd->request_bufflen;
		cmd->SCp.ptr = NULL;
		cmd->SCp.this_residual = 0;
		cmd->SCp.buffer = NULL;
	} else {
		cmd->SCp.buffer = cmd->request_buffer;
		cmd->SCp.buffers_residual = cmd->use_sg;
		cmd->SCp.buffer = scsi_sglist(cmd);
		cmd->SCp.buffers_residual = scsi_sg_count(cmd);
		cmd->SCp.ptr = sg_virt(cmd->SCp.buffer);
		cmd->SCp.this_residual = cmd->SCp.buffer->length;
	}