Messages in this thread | | | Date | Fri, 31 Jul 2015 15:19:20 +0530 | From | Viresh Kumar <> | Subject | Re: [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
| |