[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20200901092729.427515-1-efremov@linux.com>
Date: Tue, 1 Sep 2020 12:27:29 +0300
From: Denis Efremov <efremov@...ux.com>
To: Julia Lawall <Julia.Lawall@...6.fr>
Cc: Denis Efremov <efremov@...ux.com>, cocci@...teme.lip6.fr,
linux-kernel@...r.kernel.org
Subject: [PATCH] coccinelle: api: kobj_to_dev: don't warn about kobj_to_dev()
Exclude kobj_to_dev() definition from warnings.
Signed-off-by: Denis Efremov <efremov@...ux.com>
---
No changes in performance. This patch can be squashed to the
original patch with kobj_to_dev.cocci script.
scripts/coccinelle/api/kobj_to_dev.cocci | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/scripts/coccinelle/api/kobj_to_dev.cocci b/scripts/coccinelle/api/kobj_to_dev.cocci
index cd5d31c6fe76..d0b3b9647c19 100644
--- a/scripts/coccinelle/api/kobj_to_dev.cocci
+++ b/scripts/coccinelle/api/kobj_to_dev.cocci
@@ -15,10 +15,18 @@ virtual org
virtual patch
+@...tialize:python@
+@@
+filter = frozenset(['kobj_to_dev'])
+
+def relevant(p):
+ return not (filter & {el.current_element for el in p})
+
+
@r depends on !patch@
expression ptr;
symbol kobj;
-position p;
+position p : script:python() { relevant(p) };
@@
* container_of(ptr, struct device, kobj)@p
@@ -26,9 +34,10 @@ position p;
@depends on patch@
expression ptr;
+position p : script:python() { relevant(p) };
@@
-- container_of(ptr, struct device, kobj)
+- container_of(ptr, struct device, kobj)@p
+ kobj_to_dev(ptr)
--
2.26.2
Powered by blists - more mailing lists