Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4500514ybb; Tue, 7 Apr 2020 08:40:15 -0700 (PDT) X-Google-Smtp-Source: APiQypKvzwYA4OrXCD3fAmCZWPUdh0tqSIbxUwVIZ0qLitMlSKa5asdTHkYsqmlth3gFCTBhiztP X-Received: by 2002:a4a:e38c:: with SMTP id l12mr2357750oov.7.1586274014933; Tue, 07 Apr 2020 08:40:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586274014; cv=none; d=google.com; s=arc-20160816; b=TMxg38rzdNShB3uvmdtdQmo7HI1pRxspXRYPck/DxxyYIeDQzQKbGm7wzSk/737OM0 zJmVg4Ooo+RHfHtqClJb4LH5G33RmjgBjC6BQXE9TLN98yERG6pnZZQJXPDKQZoxZSgY KwbwjaF0Xz0lMcYelgnV1PJl/xWyWK6lWVWtIz/W0NEXMam32adoJRi45iUuxJM+Xg9Z 30qqtpxeZX76kEx9aJkUf1oP1I2S47mIJN35qeYuCaspmRdcWVIBdRtSZLuZuH99o9Ul 5swLohud1+E71sL5I2eeKEgWgLZFHeKQ5qvIqI9d9+xjgTQf8DIqz3A3A8Kh4xoAbE8D QKEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:cc:to:from:subject:date :in-reply-to:original:originalfrom:originaldate :content-transfer-encoding:dkim-signature; bh=Y5PSMe9piJCaGI0IRzsBXKtHWT0LsKWAAPpNVadifOo=; b=gTaL7jSyedai/LvaoGYfehewBKhA1nqK7CDHLvEOuLMxGWoB5hlyuifC11K5sBKWJL 8174ySHdrKm64m+37+gOUOwgpE3YifHy3rRa3/K4/S9Hlhh4kLGKQLbt2MYHUG6pkK/Q RFUPMX0S7HuJEW92cETaNn9ku46/wld+WA0bN0ny+q3p+TBLyZDv/PZu+gWTpeEx3vOR ZxsgsX9PG9AEy6B2/OOq2kPNzgN1MLUYXzZHyxjo00zytSIVmUQsRteXhgRiscDmM86D JADzb1A3vxwO5NTaNsFfUEuND2TggM4PfAHYDI/F3BZnNMb4V+1K8l1/Gd7Vp/+TfV/r U+Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=LTuBE0ye; 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 e6si833933oiy.229.2020.04.07.08.40.02; Tue, 07 Apr 2020 08:40:14 -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; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=LTuBE0ye; 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 S1729485AbgDGPiC (ORCPT + 99 others); Tue, 7 Apr 2020 11:38:02 -0400 Received: from mout.gmx.net ([212.227.17.21]:43569 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729461AbgDGPiB (ORCPT ); Tue, 7 Apr 2020 11:38:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1586273864; bh=g2uJ6o2iY2X8ADAqYJvN/8HKJqod4CmmvCO7oBx7mW8=; h=X-UI-Sender-Class:In-Reply-To:Date:Subject:From:To:Cc; b=LTuBE0yeI9zXcZ7sK/jkGRXRJwyeQknRnQyCCmvWtW59MowiDCBZP7HGMVedDIwHQ gQj9b35mpjmzxN3Rew40xOJiyzftLRzXbqr2CVWh1bIuQ6ANWMLGHQ+qDsnwjeeKCN JldOeKJp53RzsvWdxYIpskuxnApxzxaPQ9KA+38I= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost ([82.19.195.159]) by mail.gmx.com (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1M5wLT-1jOqAm3vYJ-007Vxa; Tue, 07 Apr 2020 17:37:44 +0200 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Originaldate: Mon Apr 6, 2020 at 9:15 PM Originalfrom: "Julia Lawall" Original: =?utf-8?q?=0D=0A=0D=0AOn_Fri,_3_Apr_2020,_Alex_Dewar_wrote: =0D=0A=0D=0A>_?= =?utf-8?q?Commit_dfd32cad146e_("dma-mapping:_remove_dma =5Fzalloc=5Fcohere?= =?utf-8?q?nt()"),_in=0D=0A>_removing_dma=5Fzalloc =5Fcoherent()_treewide,_?= =?utf-8?q?inadvertently_removed_the_patch =0D=0A>_rule_for_dma=5Falloc=5Fc?= =?utf-8?q?oherent(),_leaving_Coccinelle_unable_to_auto-generate=0D=0A>_pa?= =?utf-8?q?tches_for_this_case._Fix_this.=0D=0A>=0D=0A>_Fixes:_dfd32cad146?= =?utf-8?q?e_("dma-mapping:_remove_dma=5Fzalloc=5Fcoherent()")=0D=0A>_CC:_?= =?utf-8?q?Luis_Chamberlain_=0D=0A>_Signed-off-by:_Alex?= =?utf-8?q?_Dewar_=0D=0A>_---=0D=0A>__scripts/coccin?= =?utf-8?q?elle/api/alloc/zalloc-simple.cocci_|_9_+++++++++=0D=0A>__1_file?= =?utf-8?q?_changed,_9_insertions(+)=0D=0A>=0D=0A>_diff_--git_a/scripts/co?= =?utf-8?q?ccinelle/api/alloc/zalloc-simple.cocci_b/scripts/coccinelle/api?= =?utf-8?q?/alloc/zalloc-simple.cocci=0D=0A>_index_26cda3f48f01..c53aab7fe?= =?utf-8?q?096_100644=0D=0A>_---_a/scripts/coccinelle/api/alloc/zalloc-sim?= =?utf-8?q?ple.cocci=0D=0A>_+++_b/scripts/coccinelle/api/alloc/zalloc-simp?= =?utf-8?q?le.cocci=0D=0A>_@@_-70,6_+70,15_@@_statement_S;=0D=0A>__-_x_=3D?= =?utf-8?q?_(T)vmalloc(E1);=0D=0A>__+_x_=3D_(T)vzalloc(E1);=0D=0A>__|=0D?= =?utf-8?q?=0A>_+-_x_=3D_dma=5Falloc=5Fcoherent(E2,E1,E3,E4);=0D=0A>_++_x_?= =?utf-8?q?=3D_dma=5Falloc=5Fcoherent(E2,E1,E3,E4);=0D=0A=0D=0AHi,=0D=0A?= =?utf-8?q?=0D=0AI_don't_understand_the_above_case.__The_before_and_after_?= =?utf-8?q?code_seem_to_be=0D=0Athe_same=3F=0D=0A=0D=0Ajulia=0D=0A=0D=0A?= =?utf-8?q?=0D=0A>_+|=0D=0A>_+-_x_=3D_(T_*)dma=5Falloc=5Fcoherent(E2,E1,E3?= =?utf-8?q?,E4);=0D=0A>_++_x_=3D_dma=5Falloc=5Fcoherent(E2,E1,E3,E4);=0D?= =?utf-8?q?=0A>_+|=0D=0A>_+-_x_=3D_(T)dma=5Falloc=5Fcoherent(E2,E1,E3,E4);?= =?utf-8?q?=0D=0A>_++_x_=3D_(T)dma=5Falloc=5Fcoherent(E2,E1,E3,E4);=0D=0A>?= =?utf-8?q?_+|=0D=0A>__-_x_=3D_kmalloc=5Fnode(E1,E2,E3);=0D=0A>__+_x_=3D_k?= =?utf-8?q?zalloc=5Fnode(E1,E2,E3);=0D=0A>__|=0D=0A>_--=0D=0A>_2.26.0=0D?= =?utf-8?q?=0A>=0D=0A>=0D=0A?= In-Reply-To: Date: Tue, 07 Apr 2020 16:37:42 +0100 Subject: Re: [PATCH] Coccinelle: zalloc_simple: Fix patch mode for dma_alloc_coherent() From: "Alex Dewar" To: "Julia Lawall" Cc: "Luis Chamberlain" , "Gilles Muller" , "Nicolas Palix" , "Michal Marek" , "Thomas Gleixner" , "Kate Stewart" , "Allison Randal" , "Greg Kroah-Hartman" , , Message-Id: X-Provags-ID: V03:K1:6b18JbwaHNn7jbe+QGUL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RT YPKanFHttiXpkgaKMnIz3PK6uo4blI0qNP8RNkuIeD56Z1e5IvKk9cEdhkGsiB8VCuYEooQ/O B0c4LGPiHsn9qAxidFdpLBYJpikgzayIeavr217qZ2ePe4/ge2d/LMxxurvq5BBRRvO1M/vat clxM7Viehp28NBhbL0F2OSJBavxfC9f+3EioeUryzwZDKmLQeEN5+cg+ieKx9jJoGoFRzCMX4 WahCS8/TDgM9s7sP1l7RfdjuWT8TrTwavxqpq9Fd/aOiOLemPUy+ya2j5fmTQbuZTEk63ILO4 f0JSJYNI4hmM0FyIl6kF1GneuRIt0Hf0Nvrxr4F4Evo2jwH2v3L1xY31U79BNRkrBT/aPENBm sCUOlbquTFDIGDUfCu4JM9Dv3+3PTRgVC9CXtkWzKEUd9HgHGCSqL1eoYm8mQJJzQAjz/pNOP ESx4teoSEDyTtlSvh Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon Apr 6, 2020 at 9:15 PM, Julia Lawall wrote: > >=20 > >=20 > On Fri, 3 Apr 2020, Alex Dewar wrote: > >=20 > > Commit dfd32cad146e ("dma-mapping: remove dma_zalloc_coherent()"), in > > removing dma_zalloc_coherent() treewide, inadvertently removed the patc= h > > rule for dma_alloc_coherent(), leaving Coccinelle unable to auto-genera= te > > 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 =3D (T)vmalloc(E1); > > + x =3D (T)vzalloc(E1); > > | > > +- x =3D dma_alloc_coherent(E2,E1,E3,E4); > > ++ x =3D dma_alloc_coherent(E2,E1,E3,E4); > >=20 > Hi, > >=20 > I don't understand the above case. The before and after code seem to be > the same? > >=20 > julia > >=20 > >=20 > > +| > > +- x =3D (T *)dma_alloc_coherent(E2,E1,E3,E4); > > ++ x =3D dma_alloc_coherent(E2,E1,E3,E4); > > +| > > +- x =3D (T)dma_alloc_coherent(E2,E1,E3,E4); > > ++ x =3D (T)dma_alloc_coherent(E2,E1,E3,E4); > > +| > > - x =3D kmalloc_node(E1,E2,E3); > > + x =3D kzalloc_node(E1,E2,E3); > > | > > -- > > 2.26.0 > > > > > >=20 > >=20