]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - coccinelle/iovec-make.cocci
coccinelle: don't run iovec-make on iovec_done{,_erase}
[thirdparty/systemd.git] / coccinelle / iovec-make.cocci
index 79116882fc7079fd2662bf693209cd5f2adf6486..bbbf4a2b008cdca866f96376fbd37687304b0174 100644 (file)
@@ -13,9 +13,13 @@ expression x, p, l;
 - x.iov_len = l;
 + x = IOVEC_MAKE(p, l);
 @@
+/* Don't run this transformation on iovec_done() and iovec_done_erase(),
+ * since the result, albeit correct, is a bit funky. */
+ position pos : script:python() { pos[0].current_element != "iovec_done" and
+                                  pos[0].current_element != "iovec_done_erase" };
 expression x, p, l;
 @@
-- x->iov_base = p;
+- x->iov_base@pos = p;
 - x->iov_len = l;
 + *x = IOVEC_MAKE(p, l);
 @@