Hi
In lxr, I saw the likely and unlikely macro defined as (compiler.h)

#  define likely(x)     (__builtin_constant_p(x) ? !!(x) :
__branch_check__(x, 1))
 116# endif
 117# ifndef unlikely
 118#  define unlikely(x)   (__builtin_constant_p(x) ? !!(x) :
__branch_check__(x, 0))
 119# endif
 120
..... some other defines

#else
 146# define likely(x)      __builtin_expect(!!(x), 1)
 147# define unlikely(x)    __builtin_expect(!!(x), 0)
 148#endif

I cannot understand the intention behind !!(x).
Please can you let me know why !!(x) is required here.

TIA
--
~/asd

_______________________________________________
Kernelnewbies mailing list
[email protected]
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Reply via email to