Re: [PATCH] drm/i915: Avoid clearing the base drm_crtc_state

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

 



On Mon, Mar 06, 2017 at 06:46:16PM +0100, Daniel Vetter wrote:
> On Fri, Mar 03, 2017 at 03:46:44PM +0000, Chris Wilson wrote:
> > @@ -11289,9 +11287,9 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state)
> >  	if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
> >  		wm_state = crtc_state->wm;
> >  
> > -	memset(crtc_state, 0, sizeof *crtc_state);
> > +	memset(&crtc_state->base + 1, 0,
> > +	       sizeof(*crtc_state) - sizeof(crtc_state->base));
> 
> Maybe add a comment like /* Only clear our part of the overall struct. */
> or similar, since this is not entirely obvious what's going on. Also
> 
> 	COMPILE_BUG_ON(offsetof(struct intel_crtc_state, base) != 0);
> 
> maybe? Anyway, I'll let you decide on both, either way:

I thought we had the BUILD_BUG_ON already -- the NULL correspondance is
widely used. I did one version with it, then thought that it would be
better in to_intel_crtc_state() and so left it out.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
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