[Intel-gfx] [PATCH 5/5 v3] drm/i915: debugfs spring cleaning

David Weinehall david.weinehall at linux.intel.com
Fri Aug 12 12:36:10 UTC 2016


On Fri, Aug 12, 2016 at 01:03:24PM +0100, Chris Wilson wrote:
> On Fri, Aug 12, 2016 at 02:20:12PM +0300, David Weinehall wrote:
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > index d8cc52c7ddf8..3efc5af97231 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -2046,6 +2046,12 @@ static inline struct drm_i915_private *to_i915(const struct drm_device *dev)
> >  	return container_of(dev, struct drm_i915_private, drm);
> >  }
> >  
> > +static inline struct drm_i915_private *cast_to_i915(void *data)
> > +{
> > +	struct drm_device *dev = data;
> > +	return to_i915(dev);
> > +}
> 
> I wouldn't put this in i915_drv.h as this is very specific to the
> callsite, as it must know it has a void pointer to struct drm_device.
> Especially as to_i915() just works, right?

While it does indeed rely on the callsite, there are places outside
of i915_debugfs that could benefit from this (and if I remember
correctly my patch series that transitions things to dev_priv
makes use of it elsewhere.


Kind regards, David


More information about the Intel-gfx mailing list