summaryrefslogtreecommitdiffstats
path: root/coccinelle/iovec-make.cocci
blob: 79116882fc7079fd2662bf693209cd5f2adf6486 (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
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression x, y, p, l;
@@
- x[y].iov_base = p;
- x[y].iov_len = l;
- y++;
+ x[y++] = IOVEC_MAKE(p, l);
@@
expression x, p, l;
@@
- x.iov_base = p;
- x.iov_len = l;
+ x = IOVEC_MAKE(p, l);
@@
expression x, p, l;
@@
- x->iov_base = p;
- x->iov_len = l;
+ *x = IOVEC_MAKE(p, l);
@@
expression s;
@@
- IOVEC_MAKE(s, strlen(s));
+ IOVEC_MAKE_STRING(s);
@@
expression x, y, z;
@@
- x = (struct iovec) { .iov_base = y, .iov_len = z };
+ x = IOVEC_MAKE(y, z);