Skip to content

Commit

Permalink
[PATCH] libata: trivial updates to ata_sg_init_one()
Browse files Browse the repository at this point in the history
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: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Dec 2, 2006
1 parent 8a93758 commit 61c0596
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
struct scatterlist *sg;

qc->flags |= ATA_QCFLAG_SINGLE;

memset(&qc->sgent, 0, sizeof(qc->sgent));
qc->__sg = &qc->sgent;
qc->n_elem = 1;
qc->orig_n_elem = 1;
qc->buf_virt = buf;
qc->nbytes = buflen;

sg = qc->__sg;
sg_init_one(sg, buf, buflen);
sg_init_one(&qc->sgent, buf, buflen);
}

/**
Expand Down

0 comments on commit 61c0596

Please sign in to comment.