Re: [PATCH v2 3/6] drm/i915: tidy up initialisation failure paths (legacy)

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

 



On Mon, Jan 25, 2016 at 12:08:11PM +0000, Dave Gordon wrote:
> On 25/01/16 10:52, Chris Wilson wrote:
> >On Fri, Jan 22, 2016 at 11:10:08PM +0000, Dave Gordon wrote:
> >>+	if (ringbuf) {
> >>  		intel_stop_ring_buffer(ring);
> >>-		WARN_ON(!IS_GEN2(ring->dev) && (I915_READ_MODE(ring) & MODE_IDLE) == 0);
> >>
> >>-		intel_unpin_ringbuffer_obj(ring->buffer);
> >>-		intel_ringbuffer_free(ring->buffer);
> >>+		if (ringbuf->virtual_start)
> >
> >Cleaner code, and more idiomatic, if we let unpin early return.
> 
> Maybe, but that's not the way it was previously written, so I didn't change
> it around.

We unfortunately let a lot of these through ... Early returns are
preferred, if it's possible. Same for skips in loops using if (!cond)
continue;, it makes for much less right-leaning code.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://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