projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'upstream-fixes'
[firefly-linux-kernel-4.4.55.git]
/
include
/
linux
/
libata.h
diff --git
a/include/linux/libata.h
b/include/linux/libata.h
index 0d6bf50ad02958ca598aaf5bb4ba263e9cb93e64..66b6847225df10bdead7a9f02bef8e710d1d1b52 100644
(file)
--- a/
include/linux/libata.h
+++ b/
include/linux/libata.h
@@
-615,6
+615,16
@@
ata_sg_is_last(struct scatterlist *sg, struct ata_queued_cmd *qc)
return 0;
}
return 0;
}
+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)
{
static inline struct scatterlist *
ata_qc_next_sg(struct scatterlist *sg, struct ata_queued_cmd *qc)
{
@@
-622,11
+632,13
@@
ata_qc_next_sg(struct scatterlist *sg, struct ata_queued_cmd *qc)
return NULL;
if (++sg - qc->__sg < qc->n_elem)
return sg;
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) \
}
#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)
{
static inline unsigned int ata_tag_valid(unsigned int tag)
{