Re: [RFC 13/13] Char: nozomi, cleanup read and write

Frank Seidel
2007-11-12T09:43:54Z

On Montag 12 November 2007 08:54:52, you (Adrian Bunk) wrote:
> On Sat, Nov 10, 2007 at 11:04:41PM +0100, Jiri Slaby wrote:
> > Why? Anyway I think this is the case. The body of the then branch is executed at
> > most once, while the else branch each time but last. If you write/read 1002
> > bytes, it means 250:1. ...and it's invoked from interrupt too...
>
> AFAIK there is no well defined semantics whether likely/unlikely means
> 10:1 or 10000:1 that is guaranteed to not change during the next
> 10 years.
>
> Unless there's a measurable difference, it's best to write readable
> C code and simply leave all optimizations to the compiler.

>From my (totally) beginners point of view i would have guessed a chance of
very well below one percent that this condition is true could be called
"unlikely",
but i have to admit this is most probably a much too naive way of thinking,
especially in regards of compiler optimizations.
And in this special case now there are already most calls (about 80 percent)
caught by the switch-case-shortcuts anyway.

So, i'll revert it.

Thanks a lot for your feedback,
Frank