Thread (5 messages) read the whole thread 5 messages, 4 authors, 2019-06-06

Re: [PATCH net-next] net: Drop unlikely before IS_ERR(_OR_NULL)

From: Enrico Weigelt, metux IT consult <hidden>
Date: 2019-06-06 20:42:40
Also in: linux-sctp, lkml

On 06.06.19 03:39, Kefeng Wang wrote:

Hi folks,
There is no different in assembly output (only check the x86/arm64), and
the Enrico Weigelt have finished a cocci script to do this cleanup.
I haven't compared the assembly output, just logically deduced from the
macro. If I understand it correctly, the likely()/unlikely() macros
just add a hint to the compiler, which branch it should optimize harder.

No idea what the compiler's actually doing, but I believe its things
like optimized shortcut evaluation and avoiding jumps to likely
branches.
quoted
I'm not sure in the end that the change is worth it, so would like you
to prove it is, unless davem overrides me. :-)
Depends on what you count as worthy ;-)

This patch just makes a source a bit more compact / easier to read.
But shouldn't have any actual consequence on the generated binary.


--mtx

-- 
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info@metux.net -- +49-151-27565287
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help