[Intel-gfx] [igt-dev] [PATCH i-g-t] lib/i915: Fix pointer cast build issue

Chris Wilson chris at chris-wilson.co.uk
Wed May 22 15:08:22 UTC 2019


Quoting Tvrtko Ursulin (2019-05-22 16:04:13)
> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> 
> Use from_user_pointer when casting __u64 to a pointer.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> Cc: Andi Shyti <andi.shyti at intel.com>
> ---
>  lib/i915/gem_engine_topology.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/i915/gem_engine_topology.c b/lib/i915/gem_engine_topology.c
> index dd26fae00853..7ca3616687b9 100644
> --- a/lib/i915/gem_engine_topology.c
> +++ b/lib/i915/gem_engine_topology.c
> @@ -81,7 +81,7 @@ static void ctx_map_engines(int fd, struct intel_engine_data *ed,
>                             struct drm_i915_gem_context_param *param)
>  {
>         struct i915_context_param_engines *engines =
> -                       (struct i915_context_param_engines *) param->value;
> +                       from_user_pointer(param->value);

Only a single tab indent required.

Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>

>         int i = 0;
>  
>         for (typeof(engines->engines[0]) *p =

And struct i915_engine_class_instance was added to make this for() loop
nicer.
-Chris


More information about the Intel-gfx mailing list