summaryrefslogtreecommitdiff
path: root/lib/igt_debugfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/igt_debugfs.c')
-rw-r--r--lib/igt_debugfs.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index 09d42ea0..8adc02e9 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -325,12 +325,10 @@ bool igt_debugfs_search(int device, const char *filename, const char *substring)
static bool igt_find_crc_mismatch(const igt_crc_t *a, const igt_crc_t *b,
int *index)
{
+ int nwords = min(a->n_words, b->n_words);
int i;
- if (a->n_words != b->n_words)
- return true;
-
- for (i = 0; i < a->n_words; i++) {
+ for (i = 0; i < nwords; i++) {
if (a->crc[i] != b->crc[i]) {
if (index)
*index = i;
@@ -339,6 +337,12 @@ static bool igt_find_crc_mismatch(const igt_crc_t *a, const igt_crc_t *b,
}
}
+ if (a->n_words != b->n_words) {
+ if (index)
+ *index = i;
+ return true;
+ }
+
return false;
}