lkml.org 
[lkml]   [2015]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 00/15] trivial: Drop unlikely before IS_ERR(_OR_NULL)
On 31-07-15, 11:41, Vlastimil Babka wrote:
> [+CC Steven Rostedt]
>
> Any idea what the compiler does in the case of
> "if (likely(IS_ERR(...)))"? There are apparently such cases in the source.
>
> does the "likely" somehow override the "unlikely" of IS_ERR, or is
> the resulting code a mess?

Good point. While fixing all the sites, I saw some code like that. Then before
posting the series, I tried to look at what compilers do to such codes and they
generated exactly same code for:

likely(unlikely(x)) and unlikely(x).

So, either those call sites should drop the likely bits or we supply them with
another raw version of the macro :)

Or if my tests were wrong, then please lemme know.

--
viresh


\
 
 \ /
  Last update: 2015-07-31 12:01    [W:0.412 / U:0.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site