Re: [PATCH 13/15] drm: Eliminate pointless goto

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

 



On Thu, Mar 15, 2012 at 09:57:53AM +0000, Dave Airlie wrote:
> > Use a do {} while() loop instead of a goto in drm_mode_object_get().
> 
> I don't like this one just because it diverges our idr usage from the
> canonical idr usage at
> 
> http://lwn.net/Articles/103209/
> 
> So unless there is a good reason for the change I'd rather not apply it.

That's fine by me. Although "canonical" may be an overstatement. I just
quickly went through the idr_pre_get() usage in the tree, and between
the three conteders (no loop, goto loop, while loop) it was a close
race. No loop won with 29 idr_pre_get()s, goto loop came in second
with 24, and while loop came in third with 21.

The drm subsystem itself seems to have 5 goto loops. So if we were to
change them all, goto loop would lose to the while loop.

> I've applied the other patches except this and the last one which I
> think depends on it.

The error handling in the goto version is equally broken. I'll respin
the patch on top of the goto version, and I'll check the other idr
usage under drm as well...

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux