[igt-dev] [PATCH i-g-t] RFC: gem: fix compiler warnings
Andi Shyti
andi.shyti at intel.com
Mon Oct 14 13:16:48 UTC 2019
Hi,
> > diff --git a/lib/igt_gt.h b/lib/igt_gt.h
> > index 73b5002..dcaf969 100644
> > --- a/lib/igt_gt.h
> > +++ b/lib/igt_gt.h
> > @@ -75,16 +75,16 @@ extern const struct intel_execution_engine {
> > #define for_if(expr__) if (!(expr__)) {} else
> >
> > #define for_each_engine(fd__, flags__) \
> > - for (const struct intel_execution_engine *e__ = intel_execution_engines;\
> > - e__->name; \
> > - e__++) \
> > - for_if (gem_has_ring(fd__, flags__ = e__->exec_id | e__->flags))
> > + for (const struct intel_execution_engine *e__ ## flags__ = intel_execution_engines;\
> > + e__ ## flags__->name; \
> > + e__ ## flags__++) \
> > + for_if (gem_has_ring(fd__, flags__ = e__ ## flags__->exec_id | e__ ## flags__->flags))
> >
> > #define for_each_physical_engine(fd__, flags__) \
> > - for (const struct intel_execution_engine *e__ = intel_execution_engines;\
> > - e__->name; \
> > - e__++) \
> > - for_if (gem_ring_has_physical_engine(fd__, flags__ = e__->exec_id | e__->flags))
> > + for (const struct intel_execution_engine *e__ ## flags__ = intel_execution_engines;\
> > + e__ ## flags__->name; \
> > + e__ ## flags__++) \
> > + for_if (gem_ring_has_physical_engine(fd__, flags__ = e__ ## flags__->exec_id | e__ ## flags__->flags))
>
> The plan had been to pass the iterator name to the macros. That plan got
> lost somewhere along the way.
yes, we forgot to get rid of this part, but before that we need
to do some refactoring of the gem_engine_topology, because many
things can go wrong there.
If CI does not complain, we can, in the meantime, get this in and
mute the warnings, it's not perfect, but works.
Acked-by: Andi Shyti <andi.shyti at intel.com>
Thanks JP,
Andi
More information about the igt-dev
mailing list