[Intel-gfx] [PATCH 42/49] drm/i915/bdw: Get prepared for a two-stage execlist submit process

Mateo Lozano, Oscar oscar.mateo at intel.com
Wed Apr 9 09:57:16 CEST 2014


> > > +	req = (struct drm_i915_gem_request *)
> > > +		kmalloc(sizeof(struct drm_i915_gem_request), GFP_KERNEL);
> > > +	req->ring = ring;
> > > +	req->ctx = to;
> > > +	i915_gem_context_reference(req->ctx);
> > > +	req->tail = tail;
> >
> > Need to test if the allocation has succeeded and return an error if not.
> 
> Also, no need for the cast, kmalloc returns a void *.
> 
> We usually use sizeof(*req) to be safe against variables changing type without
> updating the allocation size (someont the compiler wouldn't warn about).

Ok, will do.



More information about the Intel-gfx mailing list