Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp798525ybl; Wed, 28 Aug 2019 05:35:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLD7w45qlElArkaDpK3j8A2POi8xKzalPzxcrg1l8vPp7RE1OJRwCjouEIUPs52EiZIdy2 X-Received: by 2002:a17:902:7616:: with SMTP id k22mr4028573pll.315.1566995725027; Wed, 28 Aug 2019 05:35:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566995725; cv=none; d=google.com; s=arc-20160816; b=VFfI0UEcXXgG27iH1SFPTvikVwlHpABHY2f5pU+MB04QZED8vepC19/2iEtv97mleB DMO5ZyWIvLwllNhT99BrnuWzQ8Uapn0hgOAZKp1kBzKOAWJ+5U42zOUe1mJCfL7SXXYj QeqDI1Y7Dhaeyx189qQrWofJ0/qNZ7Jlaz9/pE15RQe/z/vPyIcz+sne/oXyGiDHkiK+ oEdSu5ezeI+4FG1w7L+ucoUugtlVoZwPn2CYsB4zMuCeuNdUXkXPTuINx7eUzin71UjO rwmAhcplOW8JIFdroWNyrgBwXQ482+4kR4K3piNQQU4CWNB03B+jeGthVhQc7HFffhYn zHLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=zCPhX4rF6D6tSIjVXvxeURLaI8oVzJRNeg5x9Ajcrl8=; b=EEGO2ArONneZsIGCpCYCSMSnXgYSi66gEVS/St8RglcKqR8B15tPwmqKkP+xK4tksU kovNYkxCeylXqeDrnmHxUFRCSJMlZnVj2+8pPgWiSGPK+GuL7Ipi7CeI1t/9upZCA2WP JCIfc65qEyqSGULPc4pipQZarN/bd8uFZtwL7wLy3JxPA5m4kROaV3g92xzQrZf7imHG dDYenI99zmpLl3yH3DpSOY7bPCPQ9wMcwq4896UoohTc9WOsYk+6EzUQW/kBcpAb2OPj 8fPruTKOGmgTTewverrzsZQJKUnzMPqOzmf3pQJ5xJdhvgDAVZ90ZxO0DbLwzhpkgCS7 ymSA== 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 u29si2045407pgm.325.2019.08.28.05.35.09; Wed, 28 Aug 2019 05:35:25 -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 S1726444AbfH1MeF (ORCPT + 99 others); Wed, 28 Aug 2019 08:34:05 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:34394 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726300AbfH1MeE (ORCPT ); Wed, 28 Aug 2019 08:34:04 -0400 X-IronPort-AV: E=Sophos;i="5.64,441,1559512800"; d="scan'208";a="399185289" Received: from unknown (HELO hadrien) ([101.5.35.205]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Aug 2019 14:33:54 +0200 Date: Wed, 28 Aug 2019 20:33:51 +0800 (CST) From: Julia Lawall X-X-Sender: julia@hadrien To: Rasmus Villemoes cc: Denis Efremov , Joe Perches , cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org, Gilles Muller , Nicolas Palix , Michal Marek Subject: Re: [PATCH] scripts: coccinelle: check for !(un)?likely usage In-Reply-To: <95c32d19-eb4d-a214-6332-038610ec3dbd@rasmusvillemoes.dk> Message-ID: References: <20190825130536.14683-1-efremov@linux.com> <88f6e48e-1230-9488-a973-397f4e6dfbb5@linux.com> <4E9DDF9E-C883-44F0-A3F4-CD49284DB60D@lip6.fr> <95c32d19-eb4d-a214-6332-038610ec3dbd@rasmusvillemoes.dk> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 28 Aug 2019, Rasmus Villemoes wrote: > On 25/08/2019 21.19, Julia Lawall wrote: > > > > > >> On 26 Aug 2019, at 02:59, Denis Efremov wrote: > >> > >> > >> > >>> On 25.08.2019 19:37, Joe Perches wrote: > >>>> On Sun, 2019-08-25 at 16:05 +0300, Denis Efremov wrote: > >>>> This patch adds coccinelle script for detecting !likely and !unlikely > >>>> usage. It's better to use unlikely instead of !likely and vice versa. > >>> > >>> Please explain _why_ is it better in the changelog. > >>> > >> > >> In my naive understanding the negation (!) before the likely/unlikely > >> could confuse the compiler > > > > As a human I am confused. Is !likely(x) equivalent to x or !x? > > #undef likely > #undef unlikely > #define likely(x) (x) > #define unlikely(x) (x) > > should be a semantic no-op. So changing !likely(x) to unlikely(x) is > completely wrong. If anything, !likely(x) can be transformed to > unlikely(!x). Thanks. Making the change seems like a good idea. julia