[igt-dev] [PATCH v23 06/14] test: perf_pmu: use the gem_engine_topology library

Chris Wilson chris at chris-wilson.co.uk
Mon May 13 14:17:46 UTC 2019


Quoting Andi Shyti (2019-05-13 15:15:34)
> Hi Chris,
> 
> On Mon, May 13, 2019 at 12:57:00PM +0100, Chris Wilson wrote:
> > Quoting Andi Shyti (2019-05-13 01:45:00)
> > >  static void
> > > -init(int gem_fd, const struct intel_execution_engine2 *e, uint8_t sample)
> > > +init(int gem_fd, struct intel_execution_engine2 *e, uint8_t sample)
> > 
> > There's a lot of const dropping where const seems appropriate throughout
> > this series? Did I misread and there's a reason throughout why we are
> > rewriting the caller's struct?
> 
> 'const' is not needed anymore... why keep variables const while
> we are not declaring them const?

It's a reminder to the programmer that the pointer is read only; it
serves as documentation that we are not allowed to write into the
struct.
-Chris


More information about the igt-dev mailing list