diff options
author | David Hardeman <david@2gen.com> | 2005-09-17 03:55:31 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2005-10-29 20:19:43 -0400 |
commit | 378f058cc49bcda7fa63d3cd86d2f9a0a5188b1c (patch) | |
tree | ed99548aa459054c7b046f0ac96af2cc50683e6e /drivers/scsi/libata-core.c | |
parent | d32311fed70d12f14e585feb4653571b1e2b0e6d (diff) |
[PATCH] Use sg_set_buf/sg_init_one where applicable
This patch uses sg_set_buf/sg_init_one in some places where it was
duplicated.
Signed-off-by: David Hardeman <david@2gen.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Cc: Greg KH <greg@kroah.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r-- | drivers/scsi/libata-core.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index b1b1c6f01419..5ca97605ff35 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -49,6 +49,7 @@ | |||
49 | #include <linux/suspend.h> | 49 | #include <linux/suspend.h> |
50 | #include <linux/workqueue.h> | 50 | #include <linux/workqueue.h> |
51 | #include <linux/jiffies.h> | 51 | #include <linux/jiffies.h> |
52 | #include <linux/scatterlist.h> | ||
52 | #include <scsi/scsi.h> | 53 | #include <scsi/scsi.h> |
53 | #include "scsi.h" | 54 | #include "scsi.h" |
54 | #include "scsi_priv.h" | 55 | #include "scsi_priv.h" |
@@ -2576,19 +2577,12 @@ void ata_qc_prep(struct ata_queued_cmd *qc) | |||
2576 | 2577 | ||
2577 | void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, unsigned int buflen) | 2578 | void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, unsigned int buflen) |
2578 | { | 2579 | { |
2579 | struct scatterlist *sg; | ||
2580 | |||
2581 | qc->flags |= ATA_QCFLAG_SINGLE; | 2580 | qc->flags |= ATA_QCFLAG_SINGLE; |
2582 | 2581 | ||
2583 | memset(&qc->sgent, 0, sizeof(qc->sgent)); | ||
2584 | qc->sg = &qc->sgent; | 2582 | qc->sg = &qc->sgent; |
2585 | qc->n_elem = 1; | 2583 | qc->n_elem = 1; |
2586 | qc->buf_virt = buf; | 2584 | qc->buf_virt = buf; |
2587 | 2585 | sg_init_one(qc->sg, buf, buflen); | |
2588 | sg = qc->sg; | ||
2589 | sg->page = virt_to_page(buf); | ||
2590 | sg->offset = (unsigned long) buf & ~PAGE_MASK; | ||
2591 | sg->length = buflen; | ||
2592 | } | 2586 | } |
2593 | 2587 | ||
2594 | /** | 2588 | /** |