Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3627794ybb; Mon, 6 Apr 2020 12:17:53 -0700 (PDT) X-Google-Smtp-Source: APiQypIz3UAYfp+esuZEx93RimHZCjMO2ljzyhZ3gQHQZUNjUXLKDwXc51xnt6wGOMCPgxeIOtmW X-Received: by 2002:a9d:a82:: with SMTP id 2mr8991758otq.87.1586200673298; Mon, 06 Apr 2020 12:17:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586200673; cv=none; d=google.com; s=arc-20160816; b=QSezKtPiHqKq+2F92jx12pZu1taeBog8Hel9lMOBy7pGCvn7XSel+q215dcVfsKCxy ZZViYAg+GuhjpXD8cXUeiKinNhpVcYb9rzqZs9cdjPqj2L7v3aM8Z8eI98RRxvJSD0VG uxerRFE5FUqm8h76xZ4EwmNHllYw1N9+EjDEbpdVMUf3800l9kkNAg/i29IHFE3Ymnvc NeESXAPgndM+zWEXplrN5WrFbU3iiWLWpYezbQi94DPR3pMiW1miAi6OHdfDSexItytR V2AICKusrKU9rywM+T7zqFn0kTqpejwFUKwC/7YmpBFUlC4q5ZJnGAh4Hm0X3El2sSlA XfCA== 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=HYbaSg8xlHoCuD0xQp9VZu/1iAYwJV1i4e50qR0PWiA=; b=QInmCtpT/evg7JbkQLNAtb8NTQvQfTcaP0yagbPN1cA5rPRqtoM21YPH8FFlOXn4QX U1w+tYAsEllfmadjWWb6IEVJX6/sjUPWYfSoTMmUer5Msjw1YEAQiiAFS9x42XBiTWWR fnUF/cbb77bLEomMNZeL8KxfNmOWLM8+OuxJZPrrVqczfheKyI90lm1cVxZrI3OLORuc k515/umCuZPwhz4WpTblOaq3nLS268xzjOAVOx0ESGjtFqsWHMuv81GdopAkYthShZJn eUfyNConjgKOwFUP/LNeWoatSfplCR1gPeHqPi4u16jtqr/YYQXVd4Hj4e/VpOBA1IuN C+eA== 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 v3si190019oog.10.2020.04.06.12.17.40; Mon, 06 Apr 2020 12:17:53 -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 S1726230AbgDFTPc (ORCPT + 99 others); Mon, 6 Apr 2020 15:15:32 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:34666 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725876AbgDFTPc (ORCPT ); Mon, 6 Apr 2020 15:15:32 -0400 X-IronPort-AV: E=Sophos;i="5.72,352,1580770800"; d="scan'208";a="345152404" Received: from abo-173-121-68.mrs.modulonet.fr (HELO hadrien) ([85.68.121.173]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Apr 2020 21:15:29 +0200 Date: Mon, 6 Apr 2020 21:15:29 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Alex Dewar cc: Luis Chamberlain , Gilles Muller , Nicolas Palix , Michal Marek , Thomas Gleixner , Kate Stewart , Allison Randal , Greg Kroah-Hartman , cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Coccinelle: zalloc_simple: Fix patch mode for dma_alloc_coherent() In-Reply-To: <20200403173011.65511-1-alex.dewar@gmx.co.uk> Message-ID: References: <20200403173011.65511-1-alex.dewar@gmx.co.uk> 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 Fri, 3 Apr 2020, Alex Dewar wrote: > Commit dfd32cad146e ("dma-mapping: remove dma_zalloc_coherent()"), in > removing dma_zalloc_coherent() treewide, inadvertently removed the patch > rule for dma_alloc_coherent(), leaving Coccinelle unable to auto-generate > patches for this case. Fix this. > > Fixes: dfd32cad146e ("dma-mapping: remove dma_zalloc_coherent()") > CC: Luis Chamberlain > Signed-off-by: Alex Dewar > --- > scripts/coccinelle/api/alloc/zalloc-simple.cocci | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/scripts/coccinelle/api/alloc/zalloc-simple.cocci b/scripts/coccinelle/api/alloc/zalloc-simple.cocci > index 26cda3f48f01..c53aab7fe096 100644 > --- a/scripts/coccinelle/api/alloc/zalloc-simple.cocci > +++ b/scripts/coccinelle/api/alloc/zalloc-simple.cocci > @@ -70,6 +70,15 @@ statement S; > - x = (T)vmalloc(E1); > + x = (T)vzalloc(E1); > | > +- x = dma_alloc_coherent(E2,E1,E3,E4); > ++ x = dma_alloc_coherent(E2,E1,E3,E4); Hi, I don't understand the above case. The before and after code seem to be the same? julia > +| > +- x = (T *)dma_alloc_coherent(E2,E1,E3,E4); > ++ x = dma_alloc_coherent(E2,E1,E3,E4); > +| > +- x = (T)dma_alloc_coherent(E2,E1,E3,E4); > ++ x = (T)dma_alloc_coherent(E2,E1,E3,E4); > +| > - x = kmalloc_node(E1,E2,E3); > + x = kzalloc_node(E1,E2,E3); > | > -- > 2.26.0 > >