Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6743566yba; Tue, 14 May 2019 12:51:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqw74x9eRyCuaXxx4vRtMYg+HOFpJGYgAaptXxPtbXDM6Qtw2cLlueDYf5DvX5puct7ttC2b X-Received: by 2002:a63:d347:: with SMTP id u7mr40064620pgi.254.1557863488236; Tue, 14 May 2019 12:51:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557863488; cv=none; d=google.com; s=arc-20160816; b=qQnh6ygo56aUrNR0qWH7kwjqPfRWVhFuz4RIWpr3q2k5p82+1Xk5APMYD2W1s06ZAc QxQaJ+ceknfxHD22qMHb7dK1SKI4VYwL3bbswnloDDrUO01mWoqrW9fNNa5z5V7MxSqL TYCNTHqxJKgm+1p91nx0aSjTFOHjYhBfRQaJ4T61yopcpbbSJyw+dPuzvZyTUZVOXiAO FSIVICP3ylte+FF6LX/VrSsvO6WYnlmrvJCFmlksWqZ1+/F/EhLA9Zd2FOaIahuhJ9Lt DNhyx9L1Yez7CtWC/KZMm+Y4Hh2mvsILMKl0qjcpb6RtRie9NiDvumYQpvg6o1tLH9A6 OkLA== 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=dCX0E8wa0+Dmd44I8G+ImIDTunAcyak2fVoqaOYcoww=; b=kW4EBeCq/BW3mqOy7ikGYKcWULUEIy5e4Ffm5YX/O6DrjXEanrBZTZhLrXi5HWbXwG RLAYHB7KQjwVi60cxsAPT0ZfcsvNHqYuouhZzhgTPo+6P5whfc3sZ3pUzRuUFPs9YN3k sTv7zzGpHtkWh9fYWyseBeTxZ/uXwSYlwBvCu1F39tTbmZ/HW99PXnceXa0nCq8JVrNe jeeaCwaEyqdguwmUEcUjMceFyVn+z0apAjQ/G0t2sm/KONf714BLZVzDtp2M9wn6dKrD WJc/D63Vvxv6W6a32CVuLAMvLAE5qVtM0Nf59jCLdQsOeZqPOsPA0UH4howIXozgjfQo saoA== 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 k13si20037879pll.64.2019.05.14.12.51.13; Tue, 14 May 2019 12:51:28 -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 S1726265AbfENTuI (ORCPT + 99 others); Tue, 14 May 2019 15:50:08 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:62336 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726036AbfENTuI (ORCPT ); Tue, 14 May 2019 15:50:08 -0400 X-IronPort-AV: E=Sophos;i="5.60,469,1549926000"; d="scan'208";a="306019325" 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:50:05 +0200 Date: Tue, 14 May 2019 21:50:04 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Markus Elfring cc: Gilles Muller , Masahiro Yamada , Michal Marek , Nicolas Palix , Wen Yang , Coccinelle , LKML , Yi Wang Subject: Re: [PATCH 1/3] Coccinelle: pci_free_consistent: Use formatted strings directly in SmPL rules In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-914917962-1557863405=:2612" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-914917962-1557863405=:2612 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT On Tue, 14 May 2019, Markus Elfring wrote: > From: Markus Elfring > Date: Tue, 14 May 2019 16:54:40 +0200 > > Formatted strings were always assigned to the Python variable “msg” > before they were used in two rules of a script for the semantic > patch language. > Delete these extra variables so that the specified string objects > are directly used for the desired data output. > > Signed-off-by: Markus Elfring NACK. If the code is going to change, I would rather it come closer to staying within 80 characters. julia > --- > scripts/coccinelle/free/pci_free_consistent.cocci | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/scripts/coccinelle/free/pci_free_consistent.cocci b/scripts/coccinelle/free/pci_free_consistent.cocci > index 43600ccb62a8..2056d6680cb8 100644 > --- a/scripts/coccinelle/free/pci_free_consistent.cocci > +++ b/scripts/coccinelle/free/pci_free_consistent.cocci > @@ -38,15 +38,15 @@ return@p2 ...; > p1 << search.p1; > p2 << search.p2; > @@ > - > -msg = "ERROR: missing pci_free_consistent; pci_alloc_consistent on line %s and return without freeing on line %s" % (p1[0].line,p2[0].line) > -coccilib.report.print_report(p2[0],msg) > +coccilib.report.print_report(p2[0], > + "ERROR: missing pci_free_consistent; pci_alloc_consistent on line %s and return without freeing on line %s" > + % (p1[0].line,p2[0].line)) > > @script:python depends on org@ > p1 << search.p1; > p2 << search.p2; > @@ > - > -msg = "ERROR: missing pci_free_consistent; pci_alloc_consistent on line %s and return without freeing on line %s" % (p1[0].line,p2[0].line) > -cocci.print_main(msg,p1) > +cocci.print_main("ERROR: missing pci_free_consistent; pci_alloc_consistent on line %s and return without freeing on line %s" > + % (p1[0].line,p2[0].line), > + p1) > cocci.print_secs("",p2) > -- > 2.21.0 > > --8323329-914917962-1557863405=:2612--