[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0dbd2dd6-4c68-1f7c-1500-9e5d40047813@users.sourceforge.net>
Date: Mon, 1 Aug 2016 13:56:58 +0200
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: Julia Lawall <julia.lawall@...6.fr>,
Amitoj Kaur Chawla <amitoj1606@...il.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Coccinelle <cocci@...teme.lip6.fr>,
Gilles Muller <Gilles.Muller@...6.fr>,
Michal Marek <mmarek@...e.com>,
Nicolas Palix <nicolas.palix@...g.fr>
Subject: Re: [Cocci] [PATCH v3] Coccinelle: Script to replace allocate and
memset with zalloc functions
>> 1. Would it make sense to merge such SmPL rules into one
>> so that code duplication could be reduced a bit
>> in such a script?
>
> I think it would suffer in readability.
How do you think about the following SmPL script example?
@vz_combined
depends on patch && !context && !org && !report@
type T;
T* pointer;
+statement S;
expression express;
@@
pointer =
- vmalloc
+ vzalloc
(...);
if (!d)
S
-memset(d, 0, sizeof(
(
-T
|
-*(express)
)
-));
> Perhaps in performance as well.
I admit that I am unsure about the run-time characteristics
for my suggestion.
Regards,
Markus
Powered by blists - more mailing lists