[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <496b3d09-47a2-3836-2899-d964267993d3@linux.com>
Date: Wed, 28 Aug 2019 15:41:43 +0300
From: Denis Efremov <efremov@...ux.com>
To: Julia Lawall <julia.lawall@...6.fr>
Cc: Joe Perches <joe@...ches.com>, cocci@...teme.lip6.fr,
linux-kernel@...r.kernel.org,
Gilles Muller <Gilles.Muller@...6.fr>,
Nicolas Palix <nicolas.palix@...g.fr>,
Michal Marek <michal.lkml@...kovi.net>
Subject: Re: [PATCH] scripts: coccinelle: check for !(un)?likely usage
>
> As a human I am confused. Is !likely(x) equivalent to x or !x?
>
> Julia
>
As far as I could understand it:
# define likely(x) __builtin_expect(!!(x), 1)
!likely(x)
!__builtin_expect(!!(x), 1)
!((!!(x)) == 1)
(!!(x)) != 1, since !! could result in 0 or 1
(!!(x)) == 0
!(!!(x))
!!!(x)
!(x)
Thanks,
Denis
Powered by blists - more mailing lists