Commit 61c0596c authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik

[PATCH] libata: trivial updates to ata_sg_init_one()

There's no need to memset &qc->sgent manually, sg_init_one() clears
sgent inside it.  Also, kill not-so-necessary sg local variable.
Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 8a937581
...@@ -3491,19 +3491,15 @@ void ata_noop_qc_prep(struct ata_queued_cmd *qc) { } ...@@ -3491,19 +3491,15 @@ void ata_noop_qc_prep(struct ata_queued_cmd *qc) { }
void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, unsigned int buflen) void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, unsigned int buflen)
{ {
struct scatterlist *sg;
qc->flags |= ATA_QCFLAG_SINGLE; qc->flags |= ATA_QCFLAG_SINGLE;
memset(&qc->sgent, 0, sizeof(qc->sgent));
qc->__sg = &qc->sgent; qc->__sg = &qc->sgent;
qc->n_elem = 1; qc->n_elem = 1;
qc->orig_n_elem = 1; qc->orig_n_elem = 1;
qc->buf_virt = buf; qc->buf_virt = buf;
qc->nbytes = buflen; qc->nbytes = buflen;
sg = qc->__sg; sg_init_one(&qc->sgent, buf, buflen);
sg_init_one(sg, buf, buflen);
} }
/** /**
......
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