[Intel-gfx] [PATCH] drm/i915: prefer INTEL_GEN(dev_priv) to INTEL_INFO(dev)->gen

Chris Wilson chris at chris-wilson.co.uk
Fri Sep 9 21:58:47 UTC 2016


On Fri, Sep 09, 2016 at 10:37:46PM +0100, Dave Gordon wrote:
> More Coccinellery ...
> 
> Wherever we find "INTEL_INFO(dev)->gen", and have a suitable
> "dev_priv" in scope, replace it with "INTEL_GEN(dev_priv)",
> which is the preferred wasy to access this device property.
> 
> This patch covers all the files that contained only relatively
> few instances, and where no manual fixup was required. A few
> more complex instances may be updated in a later patch.
> 
> @dev_priv_param@
> function FUNC;
> idexpression struct drm_device *DEV;

Oh. That's how you catch those.

> identifier DEV_PRIV;
> @@
> FUNC(..., struct drm_i915_private *DEV_PRIV, ...)
> {
>     <...
> -   INTEL_INFO(DEV)->gen
> +   INTEL_GEN(DEV_PRIV)
>     ...>
> }
> 
> @dev_priv_local@
> idexpression struct drm_device *DEV;
> identifier DEV_PRIV;
> expression E;
> @@
> {
>     ...
> (
>     struct drm_i915_private *DEV_PRIV;
> |
>     struct drm_i915_private *DEV_PRIV = E;
> )
>     <...
> -   INTEL_INFO(DEV)->gen
> +   INTEL_GEN(DEV_PRIV)
>     ...>
> }

Looks good, will have to wait until just after another merge point so
that we can apply to dinq (as well as applies to nightly).

Nothing appeared out-of-place running this against intel_display.c, just
a residual unused struct drm_dev.

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

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list