Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	"Antonio Argenziano" <antonio.argenziano@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t v4 1/3] lib/igt_aux: Add function to swap int64 in array
Date: Thu, 25 Jan 2018 13:35:30 +0200	[thread overview]
Message-ID: <87k1w6dvct.fsf@intel.com> (raw)
In-Reply-To: <20180125112150.GB5453@intel.com>

On Thu, 25 Jan 2018, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Wed, Jan 24, 2018 at 05:00:01PM -0800, Antonio Argenziano wrote:
>> Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>> Cc: Michal Winiarski <michal.winiarski@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*?
>
>> +	int_arr = array;
>> +
>> +	tmp = int_arr[i];
>> +	int_arr[i] = int_arr[j];
>> +	int_arr[j] = tmp;
>
> igt_swap()


All of the igt_exchange_whatever functions could be replaced with a
single macro that does typeof on the array parameter.

BR,
Jani.

>
>> +}
>> +
>>  /**
>>   * igt_permute_array:
>>   * @array: pointer to array
>> diff --git a/lib/igt_aux.h b/lib/igt_aux.h
>> index 02e70126..60d4de71 100644
>> --- a/lib/igt_aux.h
>> +++ b/lib/igt_aux.h
>> @@ -117,6 +117,7 @@ bool __igt_sigiter_continue(struct __igt_sigiter *iter, bool interrupt);
>>  	for (struct timespec t__={}; igt_nsec_elapsed(&t__)>>20 < (t); )
>>  
>>  void igt_exchange_int(void *array, unsigned i, unsigned j);
>> +void igt_exchange_int64(void *array, unsigned i, unsigned j);
>>  void igt_permute_array(void *array, unsigned size,
>>  			   void (*exchange_func)(void *array,
>>  						 unsigned i,
>> -- 
>> 2.14.2
>> 
>> _______________________________________________
>> igt-dev mailing list
>> igt-dev@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2018-01-25 11:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-25  1:00 [igt-dev] [PATCH i-g-t v4 1/3] lib/igt_aux: Add function to swap int64 in array Antonio Argenziano
2018-01-25  1:00 ` [igt-dev] [PATCH i-g-t v4 2/3] tests/gem_ctx_param: Update invalid param Antonio Argenziano
2018-01-25  1:00 ` [igt-dev] [PATCH i-g-t v4 3/3] tests/gem_ctx_param: Add set_priority tests for non SYS_NICE users Antonio Argenziano
2018-01-25 11:37   ` Chris Wilson
2018-01-31  0:47     ` Antonio Argenziano
2018-01-31  8:01       ` Daniel Vetter
2018-02-02 22:24         ` Antonio Argenziano
2018-02-02 22:33           ` Chris Wilson
2018-02-28 14:10   ` Arkadiusz Hiler
2018-02-28 14:15     ` Chris Wilson
2018-01-25  1:18 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v4,1/3] lib/igt_aux: Add function to swap int64 in array Patchwork
2018-01-25  2:38 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2018-01-25 11:21 ` [igt-dev] [PATCH i-g-t v4 1/3] " Ville Syrjälä
2018-01-25 11:32   ` Chris Wilson
2018-01-25 11:35   ` Jani Nikula [this message]
2018-01-26 16:50     ` Antonio Argenziano

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=87k1w6dvct.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=antonio.argenziano@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=ville.syrjala@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