Quoting Lionel Landwerlin (2020-04-28 11:08:15)
> +static int ctx_id_equal(const void *key, const void *elem)
> +{
> + const struct i915_perf_context_detail *details = elem;
> +
> + return ((int)details->id) - *((int *)key);
> +}
> +
> +static inline bool ctx_id_match(struct i915_perf_stream *stream,
> + u32 masked_ctx_id)
> +{
> + return bsearch(&masked_ctx_id,
You might as well just (void *)(uintptr_t)masked_ctx_id and
static int ctx_id_cmp(const void *key, const void *elem)
{
const struct i915_perf_context_detail *details = elem;
return details->id - (uinptr_t)key;
}
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx