From 23aa051369c2b930d35359a5c06fae5290c06291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= Date: Fri, 18 Dec 2015 19:25:47 +0200 Subject: [PATCH] lib: Use igt_assert_eq() to check for crc component count MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's nice to see just how many components the crc claims to have when the count don't match what we expect. Signed-off-by: Ville Syrjälä Signed-off-by: Daniel Vetter --- lib/igt_debugfs.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c index 4322e8ee..a3d01526 100644 --- a/lib/igt_debugfs.c +++ b/lib/igt_debugfs.c @@ -280,11 +280,10 @@ char *igt_crc_to_string(igt_crc_t *crc) { char buf[128]; - if (crc->n_words == 5) - sprintf(buf, "%08x %08x %08x %08x %08x", crc->crc[0], - crc->crc[1], crc->crc[2], crc->crc[3], crc->crc[4]); - else - igt_assert(0); + igt_assert_eq(crc->n_words, 5); + + sprintf(buf, "%08x %08x %08x %08x %08x", crc->crc[0], + crc->crc[1], crc->crc[2], crc->crc[3], crc->crc[4]); return strdup(buf); }