Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1453162

Re: [Cocci] [PATCH v3] Coccinelle: Script to replace allocate and memset with zalloc functions

From SF Markus Elfring <elfring@users.sourceforge.net>
Newsgroups linux.kernel
Subject Re: [Cocci] [PATCH v3] Coccinelle: Script to replace allocate and memset with zalloc functions
Date 2016-08-01 14:00 +0200
Message-ID <s1k2Z-5PD-9@gated-at.bofh.it> (permalink)
References <s1fwl-39b-1@gated-at.bofh.it> <s1jzX-5Fk-11@gated-at.bofh.it> <s1jJD-5J0-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


>> 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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3] Coccinelle: Script to replace allocate and memset with  zalloc functions Amitoj Kaur Chawla <amitoj1606@gmail.com> - 2016-08-01 09:10 +0200
  Re: [Cocci] [PATCH v3] Coccinelle: Script to replace allocate and  memset with zalloc functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-01 13:30 +0200
    Re: [Cocci] [PATCH v3] Coccinelle: Script to replace allocate and  memset with zalloc functions Julia Lawall <julia.lawall@lip6.fr> - 2016-08-01 13:40 +0200
      Re: [Cocci] [PATCH v3] Coccinelle: Script to replace allocate and  memset with zalloc functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-01 14:00 +0200
        Re: [Cocci] [PATCH v3] Coccinelle: Script to replace allocate and  memset with zalloc functions Julia Lawall <julia.lawall@lip6.fr> - 2016-08-01 14:10 +0200
          Re: [Cocci] [PATCH v3] Coccinelle: Script to replace allocate and  memset with zalloc functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-01 14:30 +0200
            Re: [Cocci] [PATCH v3] Coccinelle: Script to replace allocate and  memset with zalloc functions Julia Lawall <julia.lawall@lip6.fr> - 2016-08-01 14:40 +0200
              Re: [Cocci] [PATCH v3] Coccinelle: Script to replace allocate and  memset with zalloc functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-01 14:50 +0200

csiph-web