Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3398376ybl; Sun, 25 Aug 2019 15:14:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwmNQCmHBfJqa3sH5TfrSCDp7U3FqLyrcxTthbNlH+GZCcI0EBGRQxdVNqeBfALi/C83/Zv X-Received: by 2002:a62:1444:: with SMTP id 65mr16664661pfu.145.1566771253622; Sun, 25 Aug 2019 15:14:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566771253; cv=none; d=google.com; s=arc-20160816; b=Af2dKFBnDZEtBTtZpaxVkjXN4F4+CA1TSDwFHA3VRney7joOGx5W6nZAFFn4EwEayx BKL0yEmCy41/nH4qiFXVnEmfgzNkTNSxX/MUbZNnJllEp40zhiTtT7jozbMHqSXnJthB 6U2PbcxACwUVDcbPE5EaIuiH8EpwgWayLVkd5KlM89fQOMUy0pvugIUIdTouHER/K4nc p+X2kYA5TYh7yq/GwB+IwuagJvNsH8MvFg+8vpvCyt0B0sxcqLpiPeE/rpryOZZxSQjM wUWA7CybVouc22FOACjbmJ8bQ6wV0UT9wndb620ApFhS70nuc9nIGuHkMT66/BFcg5Qi KWrg== 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; bh=Ze71kdozTeXZmdb5xg2E70/uVH1FbtMCT0+dhgmaPo4=; b=MbG06ckjXa2Wry0qkKCLacULl2sOEikGn5TWOtHb7AXhKUQoygzOSHZIp5GiwtKw33 Y5kR+IHh3ojIBdQoxMWHxRGIsBKdDQb3G46VzDyF8VC2YzT8LyU8gO9m6gBh+8HY5IdL q1jXXHW0WnvV5jdgLg2SxYRlvqqmlHk+8lNHJ3Bzyo1e4FZFdvdd5OUvXwmYpbElhz0s qRdVFOU8/Qfh08qrjap2Y0Bhyo0BWPe01PozXDMXFBm1NyPJ75NHSjx5oyQjmQ8WlCmX AVaBv5i9xSv9AFteOrgBHiQmCV6iq8bbhYA2SW8n0N04uTvET3HZhAFLn1ro9qI0PutZ w8sA== 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 u5si7166413pgm.158.2019.08.25.15.13.11; Sun, 25 Aug 2019 15:14:13 -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 S1728927AbfHYVGm (ORCPT + 99 others); Sun, 25 Aug 2019 17:06:42 -0400 Received: from mail-lf1-f44.google.com ([209.85.167.44]:38267 "EHLO mail-lf1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728185AbfHYVGl (ORCPT ); Sun, 25 Aug 2019 17:06:41 -0400 Received: by mail-lf1-f44.google.com with SMTP id f21so5784595lfc.5 for ; Sun, 25 Aug 2019 14:06:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Ze71kdozTeXZmdb5xg2E70/uVH1FbtMCT0+dhgmaPo4=; b=B7PvI1jsPe3JCmdUb75NNd1QWW2IBTvexvdiEuGxDN4a7ctfocdoDoPRwsZa2U+CtK i6X1efssspE14iQ88S6/s7lZstJLcvbc5IUXeAJOgFu+i/XXedNincLv6NfoVwVm1Ldh T6PqXtQySzwoKuy0znBFBt07fBtuoA7vDELBfPtxXdl9Y8hklIswsv441kuzGPS02Rl9 5LD56Qgz71t6EDMguOLzXnideADnzg68zTi19ZAHa0s1NiMUwv0ja9WVPa/ghwECpp3u iMHIECCrbiF0desD4Rcb/+QkQuny0KiJVCkSffKxnMG9PB/1zGl9ZSmmbB7CNK+sNXzL jubQ== X-Gm-Message-State: APjAAAXJSMvTLdpTIqZsYZos2hL5R1y4H1Y+drNTqUFjhtszDd8Y1LB8 +G9ItnMtbsDHlmgRYwTu/PN65SwN X-Received: by 2002:a19:48c5:: with SMTP id v188mr3826696lfa.69.1566767199754; Sun, 25 Aug 2019 14:06:39 -0700 (PDT) Received: from [10.68.32.192] (broadband-188-32-48-208.ip.moscow.rt.ru. [188.32.48.208]) by smtp.gmail.com with ESMTPSA id z2sm1776716lfh.97.2019.08.25.14.06.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 25 Aug 2019 14:06:39 -0700 (PDT) Subject: Re: [PATCH] scripts: coccinelle: check for !(un)?likely usage To: Markus Elfring , Gilles Muller , Julia Lawall , Masahiro Yamada , Michal Marek , Nicolas Palix , cocci@systeme.lip6.fr Cc: linux-kernel@vger.kernel.org References: <20190825130536.14683-1-efremov@linux.com> From: Denis Efremov Message-ID: <23dfc168-5ad2-8bd8-0059-091bb814f2e6@linux.com> Date: Mon, 26 Aug 2019 00:06:38 +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: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25.08.2019 18:30, Markus Elfring wrote: >> +( >> +* !likely(E) >> +| >> +* !unlikely(E) >> +) > > Can the following code variant be nicer? > > +*! \( likely \| unlikely \) (E) > > >> +( >> +-!likely(E) >> ++unlikely(E) >> +| >> +-!unlikely(E) >> ++likely(E) >> +) > > I would find the following SmPL change specification more succinct. > > +( > +-!likely > ++unlikely > +| > +-!unlikely > ++likely > +)(E) > > >> +coccilib.org.print_todo(p[0], "WARNING use unlikely instead of !likely") > … >> +msg="WARNING: Use unlikely instead of !likely" >> +coccilib.report.print_report(p[0], msg) > > 1. I find such a message construction nicer without the extra variable “msg”. > > 2. I recommend to make the provided information unique. > * How do you think about to split the SmPL disjunction in the rule “r” > for this purpose? > > * Should the transformation become clearer? Thank you for the review, I will prepare v2. > > Regards, > Markus >