[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150731094920.GB11856@linux>
Date: Fri, 31 Jul 2015 15:19:20 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Vlastimil Babka <vbabka@...e.cz>
Cc: akpm@...ux-foundation.org, linaro-kernel@...ts.linaro.org,
linux-kernel@...r.kernel.org, Steven Rostedt <rostedt@...dmis.org>
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists