All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michel Thierry <michel.thierry@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/2 i-g-t] lib/igt.cocci: Add 64-bit and float compare functions
Date: Tue, 30 Jun 2015 15:08:48 +0100	[thread overview]
Message-ID: <5592A2F0.3030905@intel.com> (raw)
In-Reply-To: <20150630135427.GV1381@nuc-i3427.alporthouse.com>

On 6/30/2015 2:54 PM, Chris Wilson wrote:
> On Tue, Jun 30, 2015 at 02:41:09PM +0100, Michel Thierry wrote:
>> @@ -1109,7 +1109,7 @@ static void setup_sink_crc(void)
>>   	set_mode_for_params(&prim_mode_params);
>>
>>   	sink_crc.fd = igt_debugfs_open("i915_sink_crc_eDP1", O_RDONLY);
>> -	igt_assert(sink_crc.fd >= 0);
>> +	igt_assert_lte(0, sink_crc.fd);
>
> This one is wrong, and similar transformations.

I also saw it wrong at the beginning...
But, I think it's correct because coccinelle changed the operands order 
(the macro is checking for less-than or equals to).

- igt_assert(E3 <= E4);
+ igt_assert_lte(E3, E4);


>>
>>   	rc = read(sink_crc.fd, crc.data, SINK_CRC_SIZE);
>>   	errno_ = errno;
>> @@ -1184,7 +1184,7 @@ static bool fbc_supported_on_chipset(void)
>>   static void setup_fbc(void)
>>   {
>>   	fbc.fd = igt_debugfs_open("i915_fbc_status", O_RDONLY);
>> -	igt_assert(fbc.fd >= 0);
>> +	igt_assert_lte(0, fbc.fd);
>>
>>   	if (!fbc_supported_on_chipset()) {
>>   		igt_info("Can't test FBC: not supported on this chipset\n");
>> @@ -1220,7 +1220,7 @@ static void setup_psr(void)
>>   	}
>>
>>   	psr.fd = igt_debugfs_open("i915_edp_psr_status", O_RDONLY);
>> -	igt_assert(psr.fd >= 0);
>> +	igt_assert_lte(0, psr.fd);
>>
>>   	if (!psr_sink_has_support()) {
>>   		igt_info("Can't test PSR: not supported by sink.\n");
>> @@ -1426,13 +1426,13 @@ static void set_cursor_for_test(const struct test_mode *t,
>>   	fill_fb_region(&params->cursor, 0xFF0000FF);
>>
>>   	rc = drmModeMoveCursor(drm.fd, params->crtc_id, 0, 0);
>> -	igt_assert(rc == 0);
>> +	igt_assert_eq(rc, 0);
>
> As a general comment, not on your patch, this assert doesn't provide
> anywhere near the right information. rc here is either -1 or 0, it's the
> errno that's interesting (fortunately also printed by the assert), but
> it is igt_assert_eq(drmModeModeCursor(drm.fd, params->crtc_id, 0, 0), 0);
> that provides the most useful immediate debugging aid.
> -Chris
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-06-30 14:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-30 13:41 [PATCH 1/2 i-g-t v2] lib: Add 64-bit version of igt_assert_cmp Michel Thierry
2015-06-30 13:41 ` [PATCH 2/2 i-g-t] lib/igt.cocci: Add 64-bit and float compare functions Michel Thierry
2015-06-30 13:54   ` Chris Wilson
2015-06-30 14:08     ` Michel Thierry [this message]
2015-06-30 14:43       ` Chris Wilson
2015-06-30 14:14     ` Paulo Zanoni
2015-07-01 13:02       ` Daniel Vetter
2015-07-03  9:23         ` Dave Gordon
2015-07-03 16:52           ` Paulo Zanoni
2015-07-06  7:48             ` Daniel Vetter
2015-07-07 16:33               ` Thomas Wood
2015-06-30 14:04   ` Paulo Zanoni
2015-06-30 13:49 ` [PATCH 1/2 i-g-t v2] lib: Add 64-bit version of igt_assert_cmp Chris Wilson
2015-06-30 13:56   ` Michel Thierry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5592A2F0.3030905@intel.com \
    --to=michel.thierry@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.