Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6743005yba; Tue, 14 May 2019 12:50:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxy8+muRqi4/MzVVSJH0Ua6Im3OSRZFDzpLIaPhG2eKQhJeyZbPPlVl3+qs5dIEb6Q61i0f X-Received: by 2002:a63:541d:: with SMTP id i29mr39540118pgb.174.1557863443134; Tue, 14 May 2019 12:50:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557863443; cv=none; d=google.com; s=arc-20160816; b=uNbGGKQ4FeSGI/2XAkxhMBMETIn5UUej6tifqz5Cz7/4dV3WEdvDM36xLRkQafsVh+ GDxr7A6vSwdftv4rOR04dUOL28bvqqXf0YyWr4ee2/Tqiih02ZlLXtuNJi9WKFLrvm1r xgtSmYZ/Q2WRpMqFBRMr324/xngsFVq2q44zLsV5qsTOCNbvCVDHQgxhuk1tuX6Wbx8R thQc6KdA6pP0vLn3PuRlNOR5nqjNV8rkq2dUsdccr5Xvd2QDhTqbzShLewLnmotYhHPl F5brBD+3nU3P0QQ3tarc2rL2yyDS6LKjrLrepbalksI37qG+SPszPRC5BCsP8bpW4UVQ 2qnA== 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=JW1BJIQniVr19VOeJweB9x+b6yr09wOyO1KlSrbSQV8=; b=cKB9NwuDdPlnsYFZmkrPR+JMqhXyh7ePkFJeTF4tihhzwc4MUTaBrKRQGifECiP6xx Mxtw+rrgHWOEltBohXr+1bd+Ybjx4JRN9ZAp2UOrUhShM8nZ/4yNwvU0RXyDvxSOq9X5 cFWJenDPYOjZ0t9YhuPii30eT6DzHFklXDFDRQ3sxsFAjqC1yHtfCvcvRghHWQcHlvA6 P7EVQgR1uj7/YSen+ReSaOa2Xwbykh4ZhDo0JHS70rq82uQLDXM3XKbBiU3tX9VGN8vQ vKhNDsvUK4wQ6XLrm5Gfd4tX/DrlH50gt3pe82AH+++a+DhqNquGG6prUWeQcX0Uhz9h YXDg== 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 f184si24422837pfb.280.2019.05.14.12.50.27; Tue, 14 May 2019 12:50:43 -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 S1726211AbfENTr5 (ORCPT + 99 others); Tue, 14 May 2019 15:47:57 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:62200 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726036AbfENTr5 (ORCPT ); Tue, 14 May 2019 15:47:57 -0400 X-IronPort-AV: E=Sophos;i="5.60,469,1549926000"; d="scan'208";a="306019229" Received: from abo-218-110-68.mrs.modulonet.fr (HELO hadrien) ([85.68.110.218]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 May 2019 21:47:54 +0200 Date: Tue, 14 May 2019 21:47:54 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Markus Elfring cc: Gilles Muller , Julia Lawall , Masahiro Yamada , Michal Marek , Nicolas Palix , Wen Yang , Coccinelle , LKML , Yi Wang Subject: Re: [PATCH 2/3] Coccinelle: pci_free_consistent: Reduce a bit of duplicate SmPL code In-Reply-To: <112fa697-3073-1a95-eb5b-fa62ad9607fb@web.de> Message-ID: References: <112fa697-3073-1a95-eb5b-fa62ad9607fb@web.de> 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 Tue, 14 May 2019, Markus Elfring wrote: > From: Markus Elfring > Date: Tue, 14 May 2019 17:18:24 +0200 > > A return statement was specified with a known value for three branches > of a SmPL disjunction. > Reduce duplicate SmPL code there by using another disjunction for > these return values. > > Signed-off-by: Markus Elfring NACK. The goak is not to squeeze the most information into the fewest number of characters. The rule was fine as it was. julia > --- > scripts/coccinelle/free/pci_free_consistent.cocci | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/scripts/coccinelle/free/pci_free_consistent.cocci b/scripts/coccinelle/free/pci_free_consistent.cocci > index 2056d6680cb8..45bc14ece151 100644 > --- a/scripts/coccinelle/free/pci_free_consistent.cocci > +++ b/scripts/coccinelle/free/pci_free_consistent.cocci > @@ -25,11 +25,11 @@ if (id == NULL || ...) { ... return ...; } > when != e = (T)id > when exists > ( > -return 0; > -| > -return 1; > -| > -return id; > + return > +(0 > +|1 > +|id > +); > | > return@p2 ...; > ) > -- > 2.21.0 > >