public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Andi Shyti <andi.shyti@intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: IGT dev <igt-dev@lists.freedesktop.org>,
	Andi Shyti <andi@etezian.org>,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: Re: [igt-dev] [RFC v2 2/3] lib: implement new engine discovery interface
Date: Thu, 22 Nov 2018 15:28:27 +0200	[thread overview]
Message-ID: <20181122132827.GB2449@intel.intel> (raw)
In-Reply-To: <f8355c69-2b92-65c1-e51c-d309531d2db7@linux.intel.com>

Hi Tvrtko,

> > +		for (int __m, __e = 1; (__m = get_engines(fd, ctx)); ) \
> > +			if (__e > __m) \
> > +				break; \
> > +			else \
> > +				for(e = __e ; __e <= __m; e = ++__e)
> 
> I am struggling to figure this out, but it is probably just me. Can it cause
> some compiler warnings for misleading braces, indent or whatever the things
> are it could warn here?
> 
> Would something simpler not work?
> 
> #define for_each_engine_ctx(fd, ctx, e) \
>    for (int __e = 0, __m = get_engines(fd, ctx);
> 	(e) = __e, __e < __m;
> 	__e++)
> 
> I am probably missing something elementary...

It doesn't complain, but I already simplified this macro.
I just used Chris's way just for the RFC (also because it ends up
calling calling get_engines() twice).

I agree with all your comments from this and the other RFC. I
will post directly the patch next, with few more improvements.

Important for me was not to go off track with this.

Thanks a lot, Tvrtko,
Andi
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2018-11-22 13:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-21 16:10 [igt-dev] [RFC v2 0/3] new engine discovery interface Andi Shyti
2018-11-21 16:10 ` [igt-dev] [RFC v2 1/3] include/drm-uapi: import i915_drm.h header file Andi Shyti
2018-11-21 16:10 ` [igt-dev] [RFC v2 2/3] lib: implement new engine discovery interface Andi Shyti
2018-11-22 12:14   ` Tvrtko Ursulin
2018-11-22 13:28     ` Andi Shyti [this message]
2018-11-26  9:07     ` Andi Shyti
2018-11-26  9:27       ` Tvrtko Ursulin
2018-11-21 16:10 ` [igt-dev] [RFC v2 3/3] tests: gem_gem_query_engines_demo: create test Andi Shyti
2018-11-22 12:25   ` Tvrtko Ursulin
2018-11-21 16:51 ` [igt-dev] ✓ Fi.CI.BAT: success for new engine discovery interface (rev2) Patchwork
2018-11-22  2:45 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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=20181122132827.GB2449@intel.intel \
    --to=andi.shyti@intel.com \
    --cc=andi@etezian.org \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=tvrtko.ursulin@intel.com \
    --cc=tvrtko.ursulin@linux.intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox