From ef00c533e1ed37b414aab912f492be794ab589cc Mon Sep 17 00:00:00 2001 From: Tim Duesterhus Date: Thu, 4 Nov 2021 22:35:43 +0100 Subject: [PATCH] DEV: coccinelle: Add rule to use `istnext()` where possible This matches both `istadv(..., 1)` as well as raw `.ptr++` uses. --- dev/coccinelle/ist.cocci | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dev/coccinelle/ist.cocci b/dev/coccinelle/ist.cocci index c3243302f8..97ce0a2ade 100644 --- a/dev/coccinelle/ist.cocci +++ b/dev/coccinelle/ist.cocci @@ -26,6 +26,22 @@ expression e; struct ist i; @@ +- i = istadv(i, 1); ++ i = istnext(i); + +@@ +struct ist i; +expression e; +@@ + +- i.ptr++; +- i.len--; ++ i = istnext(i); + +@@ +struct ist i; +@@ + - i.ptr != NULL + isttest(i) -- 2.47.3