diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-21 13:11:32 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-21 13:11:32 -0500 |
commit | 52aa536f5a78bbba9205d296f53d2f8a424a3b08 (patch) | |
tree | 29ccde2430d7dd34420761b7fde4a8c8976fe76c /include | |
parent | 5914811acf36c3ff091f860a6964808f668f27d0 (diff) | |
parent | 2e242fa994428bd1a40b6a7e97430413246d0a16 (diff) |
Merge branch 'upstream-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev
Diffstat (limited to 'include')
-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 9e5db2949c58..c91be5e64ede 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) | |||
557 | } | 557 | } |
558 | 558 | ||
559 | static inline struct scatterlist * | 559 | static inline struct scatterlist * |
560 | ata_qc_first_sg(struct ata_queued_cmd *qc) | ||
561 | { | ||
562 | if (qc->n_elem) | ||
563 | return qc->__sg; | ||
564 | if (qc->pad_len) | ||
565 | return &qc->pad_sgent; | ||
566 | return NULL; | ||
567 | } | ||
568 | |||
569 | static inline struct scatterlist * | ||
560 | ata_qc_next_sg(struct scatterlist *sg, struct ata_queued_cmd *qc) | 570 | ata_qc_next_sg(struct scatterlist *sg, struct ata_queued_cmd *qc) |
561 | { | 571 | { |
562 | if (sg == &qc->pad_sgent) | 572 | if (sg == &qc->pad_sgent) |
563 | return NULL; | 573 | return NULL; |
564 | if (++sg - qc->__sg < qc->n_elem) | 574 | if (++sg - qc->__sg < qc->n_elem) |
565 | return sg; | 575 | return sg; |
566 | return qc->pad_len ? &qc->pad_sgent : NULL; | 576 | if (qc->pad_len) |
577 | return &qc->pad_sgent; | ||
578 | return NULL; | ||
567 | } | 579 | } |
568 | 580 | ||
569 | #define ata_for_each_sg(sg, qc) \ | 581 | #define ata_for_each_sg(sg, qc) \ |
570 | for (sg = qc->__sg; sg; sg = ata_qc_next_sg(sg, qc)) | 582 | for (sg = ata_qc_first_sg(qc); sg; sg = ata_qc_next_sg(sg, qc)) |
571 | 583 | ||
572 | static inline unsigned int ata_tag_valid(unsigned int tag) | 584 | static inline unsigned int ata_tag_valid(unsigned int tag) |
573 | { | 585 | { |