From 755d2419a45c19e12b72d1aa84b59242524178e9 Mon Sep 17 00:00:00 2001 From: Tim Duesterhus Date: Mon, 8 Nov 2021 09:05:02 +0100 Subject: [PATCH] DEV: coccinelle: Add rule to use `chunk_istcat()` instead of `chunk_memcat()` This replaces `chunk_memcat()` with `chunk_istcat()` if the parameters are the ist's `.ptr` and `.len`. --- dev/coccinelle/ist.cocci | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dev/coccinelle/ist.cocci b/dev/coccinelle/ist.cocci index 7e9a6ac05..4945141b2 100644 --- a/dev/coccinelle/ist.cocci +++ b/dev/coccinelle/ist.cocci @@ -52,6 +52,14 @@ expression e; - if (\(i.len\|istlen(i)\) > e) { i.len = e; } + i = isttrim(i, e); +@@ +struct ist i; +struct buffer *b; +@@ + +- chunk_memcat(b, \(i.ptr\|istptr(i)\) , \(i.len\|istlen(i)\)); ++ chunk_istcat(b, i); + @@ struct ist i; @@