From 958f50454a1aeffcef1de262e351ca0e7d3a00ac Mon Sep 17 00:00:00 2001 From: Tim Duesterhus Date: Sat, 6 Nov 2021 15:14:43 +0100 Subject: [PATCH] DEV: coccinelle: Add rule to use `istend()` where possible This replaces `i.ptr + i.len` by `istend()`. --- dev/coccinelle/ist.cocci | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dev/coccinelle/ist.cocci b/dev/coccinelle/ist.cocci index 598ffa3e2..5b6aa6b2c 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)