Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2449457pxv; Sat, 26 Jun 2021 21:58:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxv2S8bNBFyC9FB/Sqqd4TrmMFCjSTBKndRxwEPlNTzcikvNnuOJBTZ76Ir7qcsOzKIY+kd X-Received: by 2002:a92:da88:: with SMTP id u8mr13620197iln.185.1624769886118; Sat, 26 Jun 2021 21:58:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624769886; cv=none; d=google.com; s=arc-20160816; b=m8ubX0frX8KlYIF1ANK8bFcqAUc/SCVL5zqvz0MPCnHUOwDxJnLaypywJbGmFQyQYP Hvbmnh21TJ1n1sE7qR6MT2k26hTn1Fm7+B+UIYgnhFHMhKf6kDMO8GSNNuqB+GlU0B9Q eVXd45Wtrcb6svK5qxJ3I/bjRQh30ucfUkDofeVEszwewLJvdCaTpC33AQ+qGukEYfIA LncDhu+/+SJ6Wvb4iMwwBryTeusBG8umF0ZxSzP2JneLTNDJZznjB7t+71fOmJw4Y9xH c/KfYUbK6YKJRqcbRmmKve4yyBoxl6XMBNakMeOFI9Dk6Qg8RmC8BTM+RCHS705CuWjA UYQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :newsgroups:cc:to:subject; bh=T7N58ZC6opH7q4r0ib4dTHRnUYYCgAu+0ZTFakj+2c4=; b=lfVgyoUM0ngcc84gIGBs7r7apMxtIjXbSBMz5fsEs38c1xIsDFa9/gXoJQvJ69m/KW igdQDeK3/VmqMW4Lqd4NUy1J9oD+eoOYNT3EplIMI4s6IJuMAxXTZ6HN2kYNEUVC/ERH RohUBOC/8Ga7BjCYAWvAkOi02va3O7s+zx0qrfsmEcK285SzQucNNgkxuS0Fy8T8IaNW IcpQ+j3ZfAPhraRSFUSTaDRaQHiLXdjPIOXaYSrjI6l404/2IBGz+nHgwVuFfxZ5CNaQ 6AE+TTGtTTjvnB0aGGfwmk9/GY+V/2xU+Owj/sHabvokCJBCNXsb+WpEupGtqfM7G+KB /l6Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y17si13760424iow.61.2021.06.26.21.57.54; Sat, 26 Jun 2021 21:58:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229626AbhF0EyR (ORCPT + 99 others); Sun, 27 Jun 2021 00:54:17 -0400 Received: from smtp07.smtpout.orange.fr ([80.12.242.129]:45779 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbhF0EyQ (ORCPT ); Sun, 27 Jun 2021 00:54:16 -0400 Received: from [192.168.1.18] ([86.243.172.93]) by mwinf5d42 with ME id N4rq2500221Fzsu034rqeR; Sun, 27 Jun 2021 06:51:51 +0200 X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 27 Jun 2021 06:51:51 +0200 X-ME-IP: 86.243.172.93 Subject: Re: [PATCH] Coccinelle: Update and rename api/alloc/pci_free_consistent.cocci To: Julia Lawall Cc: Gilles.Muller@inria.fr, nicolas.palix@imag.fr, michal.lkml@markovi.net, cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Newsgroups: gmane.linux.kernel,gmane.comp.version-control.coccinelle,gmane.linux.kernel.janitors References: From: Christophe JAILLET Message-ID: <65419e5b-6c82-cf5a-071a-a3421f6b846a@wanadoo.fr> Date: Sun, 27 Jun 2021 06:51:48 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 26/06/2021 à 21:55, Julia Lawall a écrit : > > > On Wed, 16 Jun 2021, Christophe JAILLET wrote: > >> 'pci_alloc_consistent()' is about to be removed from the kernel. >> It is now more useful to check for dma_alloc_coherent/dma_free_coherent. > > dma_alloc_coherent has four arguments, and in the script there are only > three. Is the number of arguments to dma_alloc_coherent going to change? I don't think so. Just a stupid "typo" from my side. CJ > > julia > > >> >> So change the script accordingly and rename it. >> >> Signed-off-by: Christophe JAILLET >> --- >> Not sure that the script works. >> There are 718 'dma_alloc_coherent' calls in 5.13-rc6. It is surprising >> to have no match at all, not even a single false positive. >> --- >> ..._consistent.cocci => dma_free_coherent.cocci} | 16 ++++++++-------- >> 1 file changed, 8 insertions(+), 8 deletions(-) >> rename scripts/coccinelle/free/{pci_free_consistent.cocci => dma_free_coherent.cocci} (52%) >> >> diff --git a/scripts/coccinelle/free/pci_free_consistent.cocci b/scripts/coccinelle/free/dma_free_coherent.cocci >> similarity index 52% >> rename from scripts/coccinelle/free/pci_free_consistent.cocci >> rename to scripts/coccinelle/free/dma_free_coherent.cocci >> index d51e92556b42..75f159e7b6d7 100644 >> --- a/scripts/coccinelle/free/pci_free_consistent.cocci >> +++ b/scripts/coccinelle/free/dma_free_coherent.cocci >> @@ -1,10 +1,10 @@ >> // SPDX-License-Identifier: GPL-2.0-only >> -/// Find missing pci_free_consistent for every pci_alloc_consistent. >> +/// Find missing dma_free_coherent for every dma_alloc_coherent. >> /// >> // Confidence: Moderate >> // Copyright: (C) 2013 Petr Strnad. >> // URL: http://coccinelle.lip6.fr/ >> -// Keywords: pci_free_consistent, pci_alloc_consistent >> +// Keywords: dma_free_coherent, dma_alloc_coherent >> // Options: --no-includes --include-headers >> >> virtual report >> @@ -17,12 +17,12 @@ position p1,p2; >> type T; >> @@ >> >> -id = pci_alloc_consistent@p1(x,y,&z) >> +id = dma_alloc_coherent@p1(x,y,&z) >> ... when != e = id >> if (id == NULL || ...) { ... return ...; } >> -... when != pci_free_consistent(x,y,id,z) >> - when != if (id) { ... pci_free_consistent(x,y,id,z) ... } >> - when != if (y) { ... pci_free_consistent(x,y,id,z) ... } >> +... when != dma_free_coherent(x,y,id,z) >> + when != if (id) { ... dma_free_coherent(x,y,id,z) ... } >> + when != if (y) { ... dma_free_coherent(x,y,id,z) ... } >> when != e = (T)id >> when exists >> ( >> @@ -40,7 +40,7 @@ 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) >> +msg = "ERROR: missing dma_free_coherent; dma_alloc_coherent on line %s and return without freeing on line %s" % (p1[0].line,p2[0].line) >> coccilib.report.print_report(p2[0],msg) >> >> @script:python depends on org@ >> @@ -48,6 +48,6 @@ 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) >> +msg = "ERROR: missing dma_free_coherent; dma_alloc_coherent on line %s and return without freeing on line %s" % (p1[0].line,p2[0].line) >> cocci.print_main(msg,p1) >> cocci.print_secs("",p2) >> -- >> 2.30.2 >> >> >