From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758163AbcGZUuU (ORCPT ); Tue, 26 Jul 2016 16:50:20 -0400 Received: from mx2.suse.de ([195.135.220.15]:49235 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754821AbcGZUuQ (ORCPT ); Tue, 26 Jul 2016 16:50:16 -0400 Subject: Re: [PATCH] Coccinelle: Script to replace allocate and memcpy with zalloc functions To: Amitoj Kaur Chawla References: <20160723210034.GA19346@amitoj-Inspiron-3542> From: Michal Marek Cc: Julia.Lawall@lip6.fr, Gilles.Muller@lip6.fr, nicolas.palix@imag.fr, cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org Message-ID: <5797CCFD.7020707@suse.com> Date: Tue, 26 Jul 2016 22:50:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20160723210034.GA19346@amitoj-Inspiron-3542> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dne 23.7.2016 v 23:00 Amitoj Kaur Chawla napsal(a): > This script finds instances of allocate and memcpy which can be > replaced with a direct call to zalloc equivalent of a function. > > Signed-off-by: Amitoj Kaur Chawla > --- > scripts/coccinelle/api/zalloc.cocci | 556 ++++++++++++++++++++++++++++++++++++ > 1 file changed, 556 insertions(+) > create mode 100644 scripts/coccinelle/api/zalloc.cocci > > diff --git a/scripts/coccinelle/api/zalloc.cocci b/scripts/coccinelle/api/zalloc.cocci > new file mode 100644 > index 0000000..4f94e43 > --- /dev/null > +++ b/scripts/coccinelle/api/zalloc.cocci > @@ -0,0 +1,556 @@ > +/// Prefer zalloc functions instead of using allocate and memcpy. s/memcpy/memset/ ? The actual spatch names the correct function. Michal