[igt-dev] [PATCH i-g-t v4 1/3] lib/igt_aux: Add function to swap int64 in array

Chris Wilson chris at chris-wilson.co.uk
Thu Jan 25 11:32:02 UTC 2018


Quoting Ville Syrjälä (2018-01-25 11:21:50)
> On Wed, Jan 24, 2018 at 05:00:01PM -0800, Antonio Argenziano wrote:
> > Signed-off-by: Antonio Argenziano <antonio.argenziano at intel.com>
> > Cc: Chris Wilson <chris at chris-wilson.co.uk>
> > Cc: Michal Winiarski <michal.winiarski at intel.com>
> > ---
> >  lib/igt_aux.c | 19 +++++++++++++++++++
> >  lib/igt_aux.h |  1 +
> >  2 files changed, 20 insertions(+)
> > 
> > diff --git a/lib/igt_aux.c b/lib/igt_aux.c
> > index 8ca0b60d..8012d8ae 100644
> > --- a/lib/igt_aux.c
> > +++ b/lib/igt_aux.c
> > @@ -577,6 +577,25 @@ void igt_exchange_int(void *array, unsigned i, unsigned j)
> >       int_arr[j] = tmp;
> >  }
> >  
> > +/**
> > + * igt_exchange_int64:
> > + * @array: pointer to the array of int64_t
> > + * @i: first position
> > + * @j: second position
> > + *
> > + * Exchanges the two values at array indices @i and @j. Useful as an exchange
> > + * function for igt_permute_array().
> > + */
> > +void igt_exchange_int64(void *array, unsigned i, unsigned j)
> > +{
> > +     int64_t *int_arr, tmp;
> 
> Why void* when you really mean int64_t*?

To fit the function prototype for igt_permute_array().
-Chris


More information about the igt-dev mailing list