diff options
author | Steve French <sfrench@us.ibm.com> | 2006-02-22 23:38:53 +0000 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2006-02-22 23:38:53 +0000 |
commit | 5d2f248a5f3acac4b763439327c92091be7abb1c (patch) | |
tree | 8f30098a6d17c0367adfbb780e5a8d9a5c43ad5a /include/linux/libata.h | |
parent | a048d7a8704b35ff6372fdf5eedd4533f37b1885 (diff) | |
parent | 9e956c2dac9bec602ed1ba29181b45ba6d2b6448 (diff) | |
download | kernel-crypto-5d2f248a5f3acac4b763439327c92091be7abb1c.tar.gz kernel-crypto-5d2f248a5f3acac4b763439327c92091be7abb1c.tar.xz kernel-crypto-5d2f248a5f3acac4b763439327c92091be7abb1c.zip |
Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r-- | include/linux/libata.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h index 9e5db2949c5..c91be5e64ed 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -557,17 +557,29 @@ ata_sg_is_last(struct scatterlist *sg, struct ata_queued_cmd *qc) } static inline struct scatterlist * +ata_qc_first_sg(struct ata_queued_cmd *qc) +{ + if (qc->n_elem) + return qc->__sg; + if (qc->pad_len) + return &qc->pad_sgent; + return NULL; +} + +static inline struct scatterlist * ata_qc_next_sg(struct scatterlist *sg, struct ata_queued_cmd *qc) { if (sg == &qc->pad_sgent) return NULL; if (++sg - qc->__sg < qc->n_elem) return sg; - return qc->pad_len ? &qc->pad_sgent : NULL; + if (qc->pad_len) + return &qc->pad_sgent; + return NULL; } #define ata_for_each_sg(sg, qc) \ - for (sg = qc->__sg; sg; sg = ata_qc_next_sg(sg, qc)) + for (sg = ata_qc_first_sg(qc); sg; sg = ata_qc_next_sg(sg, qc)) static inline unsigned int ata_tag_valid(unsigned int tag) { |