Re: [PATCH] drm/i915: Enclose for_each_engine_masked macro arguments in parentheses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Tvrtko Ursulin (2018-04-06 10:24:17)
> From: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>
> 
> Enclose for_each_engine_masked macro arguments in parentheses.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/i915_drv.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 5373b171bb96..79dc715db26b 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -2149,8 +2149,8 @@ static inline struct drm_i915_private *huc_to_i915(struct intel_huc *huc)
>  
>  /* Iterator over subset of engines selected by mask */
>  #define for_each_engine_masked(engine__, dev_priv__, mask__, tmp__) \
> -       for (tmp__ = mask__ & INTEL_INFO(dev_priv__)->ring_mask;        \
> -            tmp__ ? (engine__ = (dev_priv__)->engine[__mask_next_bit(tmp__)]), 1 : 0; )
> +       for ((tmp__) = (mask__) & INTEL_INFO(dev_priv__)->ring_mask; \
> +            (tmp__) ? ((engine__) = (dev_priv__)->engine[__mask_next_bit(tmp__)]), 1 : 0; )

engine__ is a rhs, it can't have side-effects. Nor tmp__. Doesn't
enclosing in () just make the error even more opaque?
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux