Re: [PATCH 2/5] drm: Break out ioctl permission check to a separate function

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

 



On Thu, Mar 13, 2014 at 1:28 PM, Thomas Hellstrom <thellstrom@xxxxxxxxxx> wrote:
> But a compiler can't (or shouldn't) make that assumption. Just as an
> (adapted) example, imagine that
> each test had a 20% probability of returning an error. The probability
> of the function returning an error would
> then be 68%..

Otoh if you'd put the unlikely just onto the if (ret) then the
compiler could infer that by necessity all branches leading towards
this one are also unlikely. Dunno whether compilers are this clever
though, and I also don't really care if we throw a few too many
likely/unlikely annotations over the place. Just figured I'll throw
this in.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
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