From: Tejun Heo Date: Tue, 14 Nov 2006 13:35:43 +0000 (+0900) Subject: [PATCH] libata: trivial updates to ata_sg_init_one() X-Git-Tag: v2.6.20-rc1~34^2~40^2~9^2~46 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61c0596c5fbef99df5518ae449be4ab49a2c2233;p=linux-2.6 [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: Tejun Heo Signed-off-by: Jeff Garzik --- diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 21f8d61e58..a52c071988 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -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); } /**