summaryrefslogtreecommitdiff
path: root/coccinelle/memzero.cocci
blob: 90fa0ddef65583817d4f574b5ae78414f1a4bca5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression s;
@@
- memset(&s, 0, sizeof(s))
+ zero(s)
@@
expression s;
@@
- memset(s, 0, sizeof(*s))
+ zero(*s)
@@
expression s;
@@
- bzero(&s, sizeof(s))
+ zero(s)
@@
expression s;
@@
- bzero(s, sizeof(*s))
+ zero(*s)
@@
expression a, b;
@@
(
#define memzero
&
- memset(a, 0, b)
+ memzero(a, b)
)
@@
expression a, b;
@@
(
#define memzero
&
- bzero(a, b)
+ memzero(a, b)
)