From: Tim Duesterhus Date: Sat, 6 Nov 2021 14:14:43 +0000 (+0100) Subject: DEV: coccinelle: Add rule to use `istend()` where possible X-Git-Tag: v2.5-dev14~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=958f50454a1aeffcef1de262e351ca0e7d3a00ac;p=thirdparty%2Fhaproxy.git DEV: coccinelle: Add rule to use `istend()` where possible This replaces `i.ptr + i.len` by `istend()`. --- diff --git a/dev/coccinelle/ist.cocci b/dev/coccinelle/ist.cocci index 598ffa3e28..5b6aa6b2cf 100644 --- a/dev/coccinelle/ist.cocci +++ b/dev/coccinelle/ist.cocci @@ -41,6 +41,13 @@ struct ist i; struct ist i; @@ +- (\(i.ptr\|istptr(i)\) + \(i.len\|istlen(i)\)) ++ istend(i) + +@@ +struct ist i; +@@ + - i.ptr != NULL + isttest(i)