Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp807357ybl; Wed, 28 Aug 2019 05:43:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqy9qavsqr/ki5cxSneltEIwY7IvrsGukZD7udB7sF/J1tNiu9xGH8C6NQ+21FHGC/tWsxq/ X-Received: by 2002:a17:902:e589:: with SMTP id cl9mr4132228plb.221.1566996182754; Wed, 28 Aug 2019 05:43:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566996182; cv=none; d=google.com; s=arc-20160816; b=uQ79q5FepQHSfCqCb1fbVdBV9Nb7jeK9nvMiyptHKDDa3+PAMLHN/xm3fMUUaMGxvX oX+mMpr3j+mJ2/vp6ISSOVKA0/AilsH0V+1LzoUl6SBJn2XJhtFhFrPWBmj/YMRjjuFW rhtj70jMrAxiJ6cF/V+a0ehx75Mu+wWnIipmnZ5FC6MphU3j5i8aLr+DIlWtta9X0IXT CQBOaouKCSdjlf/g3TuQ0+nRy3B/DAqhVV8Lpo+AdWDmy6mcHaYp1VQCICnBdMcQmnUZ +/jjj4K+7DTDa21tOVmRvH6ILuu+f4I8TSzeSiJsSzmQ/mR5an0YB3JM8s7L2CgQorXC llFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:reply-to; bh=XQb3z9P4gf099Mugft8AnZzlB0sXTeRvVgkGP0skJyk=; b=VL8MEgGfrJA9exDdvxwiRTsXh71ZoQ6o0nkoBPMGwYyxyeALbrqTEZM9oLHcAhicRj qh5UmvtEeidVe4kG0tHWSLVcS22lHtmxBT3s9Trx7SolwCQGV3cGcftXaFm17wWqBEWA xGkAMEBqs/lM9OyaN+flWwPQEqlD26FB6UmN1Upyvz0QfhnmH1eNUlYj110WRw0/f5q5 WAm8Yl1glDslnGL5JH0XGpXsej9ndRsNbzTO/+cdh9F3iU8eWmKTvLzWYe6ZhFf13Qf5 fd9oz1MUVsKHkEALY9bK63QoviTHBpFllEA+zlkssIBqR69lJugt/9SwAPOZ58Um3bhQ nWEg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l1si2162516pgt.137.2019.08.28.05.42.42; Wed, 28 Aug 2019 05:43:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726513AbfH1Mlr (ORCPT + 99 others); Wed, 28 Aug 2019 08:41:47 -0400 Received: from mail-ed1-f42.google.com ([209.85.208.42]:35621 "EHLO mail-ed1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726438AbfH1Mlr (ORCPT ); Wed, 28 Aug 2019 08:41:47 -0400 Received: by mail-ed1-f42.google.com with SMTP id t50so2882501edd.2 for ; Wed, 28 Aug 2019 05:41:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=XQb3z9P4gf099Mugft8AnZzlB0sXTeRvVgkGP0skJyk=; b=S6458ypgOU5jorIyO8hSuva+Y9SCSumx+waVFCA70BgHgcOpy/ZrCb6z/aoWy0LORL o84+uD+0zdEQ7d1zt7bLKACmiIApsFZYpZEkKWPeNt2yQwD919LgdIvt9UOMQG0tfHgF TwGQg/bGdjQywXj8VIlh4A1LPF49iehaKeoqYgB+4hPisyK6wazD3hgivofeBsch7cyx a3R/jQJ4yuU/yyrY8cNhUIt+UT9q6jAO/jfF4b9IXZ76WNZTKHKB1OksSso1WZCj65Do Z4ft2+qssjHBnGAbI4lu4xebJNpGr8fqq1pU0a4xP88KbdAbW2haBn+BHSu9kJh8Flms qGMg== X-Gm-Message-State: APjAAAUdaQwVBe1Oyn1qKThjWx9ldFXWYlB6lNTH5ZqHfCHNXL/UYGYg 4hvdyMNuDvAmWGlgELdndmE= X-Received: by 2002:a50:fd10:: with SMTP id i16mr3650722eds.97.1566996105050; Wed, 28 Aug 2019 05:41:45 -0700 (PDT) Received: from [10.10.2.174] (bran.ispras.ru. [83.149.199.196]) by smtp.gmail.com with ESMTPSA id 59sm440043edg.44.2019.08.28.05.41.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Aug 2019 05:41:44 -0700 (PDT) Reply-To: efremov@linux.com Subject: Re: [PATCH] scripts: coccinelle: check for !(un)?likely usage To: Julia Lawall Cc: Joe Perches , cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org, Gilles Muller , Nicolas Palix , Michal Marek References: <20190825130536.14683-1-efremov@linux.com> <88f6e48e-1230-9488-a973-397f4e6dfbb5@linux.com> <4E9DDF9E-C883-44F0-A3F4-CD49284DB60D@lip6.fr> From: Denis Efremov Message-ID: <496b3d09-47a2-3836-2899-d964267993d3@linux.com> Date: Wed, 28 Aug 2019 15:41:43 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <4E9DDF9E-C883-44F0-A3F4-CD49284DB60D@lip6.fr> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > 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