On Wed, Mar 15, 2017 at 12:02:21PM +0100, Michal Wajdeczko wrote:
> On Tue, Mar 14, 2017 at 08:53:02PM +0000, Chris Wilson wrote:
> > From: Michal Wajdeczko <[email protected]>
> > 
> > Manual pointer manipulation is error prone. Let compiler calculate
> > right offsets for us in case we need to change ads layout.
> > 
> > v2: don't call it object (Chris)
> > v3: restyle offset assignments (Chris)
> > v4: stylistic reductions
> > 
> > Signed-off-by: Michal Wajdeczko <[email protected]>
> > Cc: Oscar Mateo <[email protected]>
> > Cc: Joonas Lahtinen <[email protected]>
> > Cc: Daniele Ceraolo Spurio <[email protected]>
> > Cc: Chris Wilson <[email protected]>
> > Reviewed-by: Chris Wilson <[email protected]>
> > ---
> >  drivers/gpu/drm/i915/i915_guc_submission.c | 51 
> > ++++++++++++++----------------
> >  1 file changed, 23 insertions(+), 28 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c 
> > b/drivers/gpu/drm/i915/i915_guc_submission.c
> > index b4d24cd7639a..3651a1b0d13c 100644
> > --- a/drivers/gpu/drm/i915/i915_guc_submission.c
> > +++ b/drivers/gpu/drm/i915/i915_guc_submission.c
> > @@ -806,26 +806,27 @@ static void guc_policies_init(struct guc_policies 
> > *policies)
> >     policies->is_valid = 1;
> >  }
> >  
> > +#define p_offset(ptr, member) offsetof(typeof(*ptr), member)
> > +
> 
> I would place this helper macro in i915_utils.h ;)

I wanted to call it ptr_offset, more suitale for i915_utils.h, but
didn't fit into 80cols :)
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to