aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/dma-debug.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index ad65fc0317d9..c71e2dd2750f 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -262,11 +262,12 @@ static struct dma_debug_entry *hash_bucket_find(struct hash_bucket *bucket,
262 */ 262 */
263 matches += 1; 263 matches += 1;
264 match_lvl = 0; 264 match_lvl = 0;
265 entry->size == ref->size ? ++match_lvl : match_lvl; 265 entry->size == ref->size ? ++match_lvl : 0;
266 entry->type == ref->type ? ++match_lvl : match_lvl; 266 entry->type == ref->type ? ++match_lvl : 0;
267 entry->direction == ref->direction ? ++match_lvl : match_lvl; 267 entry->direction == ref->direction ? ++match_lvl : 0;
268 entry->sg_call_ents == ref->sg_call_ents ? ++match_lvl : 0;
268 269
269 if (match_lvl == 3) { 270 if (match_lvl == 4) {
270 /* perfect-fit - return the result */ 271 /* perfect-fit - return the result */
271 return entry; 272 return entry;
272 } else if (match_lvl > last_lvl) { 273 } else if (match_lvl > last_lvl) {
@@ -1076,16 +1077,14 @@ void debug_dma_unmap_sg(struct device *dev, struct scatterlist *sglist,
1076 .dev_addr = sg_dma_address(s), 1077 .dev_addr = sg_dma_address(s),
1077 .size = sg_dma_len(s), 1078 .size = sg_dma_len(s),
1078 .direction = dir, 1079 .direction = dir,
1079 .sg_call_ents = 0, 1080 .sg_call_ents = nelems,
1080 }; 1081 };
1081 1082
1082 if (mapped_ents && i >= mapped_ents) 1083 if (mapped_ents && i >= mapped_ents)
1083 break; 1084 break;
1084 1085
1085 if (!i) { 1086 if (!i)
1086 ref.sg_call_ents = nelems;
1087 mapped_ents = get_nr_mapped_entries(dev, s); 1087 mapped_ents = get_nr_mapped_entries(dev, s);
1088 }
1089 1088
1090 check_unmap(&ref); 1089 check_unmap(&ref);
1091 } 1090 }