Hola Diego! On Sat, Oct 07, 2006 at 11:36:37AM -0300, Diego Woitasen wrote: > I understand the meaning of likely() and unlikely() in linux/compiler.h, > but I don't undertand the meaning of !! in the definition. > > #define likely(x) __builtin_expect(!!(x), 1) > #define unlikely(x) __builtin_expect(!!(x), 0) > > why not this?: > > #define likely(x) __builtin_expect((x), 1) > #define unlikely(x) __builtin_expect((x), 0) Think of __builtin_expect as a comparison, then (x)==1 will be true only for x being exactly 1 , but !!(x)==1 will be true any x!=0 (those '!' act as "booleanizers"), and you want [un]likely to follow same C lang rules (TRUE is anything but 0). Regards! -- --Juanjo # Juan Jose Ciarlante (JuanJo) jjo ;at; mendoza.gov.ar # # GnuPG Public Key: gpg --keyserver wwwkeys.eu.pgp.net --recv-key 66727177 # # Key fingerprint: 0D2F 3E5D 8B5C 729E 0560 F453 A3F7 E249 6672 7177 # -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/