Re: [PATCH i-g-t 3/6] lib: Use igt_assert_eq() to check for crc component count

Daniel Vetter
2015-12-21T15:55:16Z

On Fri, Dec 18, 2015 at 07:25:47PM +0200, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> 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ä <ville.syrjala@linux.intel.com>

Assuming that you're on vacation already merged patches 1&3.

Thanks, Daniel

> ---
> 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 4322e8eebb3c..a3d015267e15 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);
> }
> --
> 2.4.10
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

--
Daniel Vetter
Software Engineer, Intel Corporation