[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <dd0da1bd-12d7-4820-9513-4a04cc13d8b8@web.de>
Date: Tue, 30 Sep 2025 19:45:20 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Gal Pressman <gal@...dia.com>, Tariq Toukan <tariqt@...dia.com>,
cocci@...ia.fr, Alexei Lazar <alazar@...dia.com>,
Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Julia Lawall <Julia.Lawall@...ia.fr>,
Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>, netdev@...r.kernel.org,
linux-rdma@...r.kernel.org, Leon Romanovsky <leon@...nel.org>,
Mark Bloch <mbloch@...dia.com>, Nicolas Palix <nicolas.palix@...g.fr>,
Richard Cochran <richardcochran@...il.com>,
Saeed Mahameed <saeedm@...dia.com>
Subject: [PATCH 6/6] Coccinelle: ptr_err_to_pe: Distinguish implementation
details better for operation mode properties
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Tue, 30 Sep 2025 18:24:19 +0200
The coccicheck operation modes are connected with data format requirements.
Take them better into account in the affected SmPL code.
* The mode “context” works without an extra position variable.
* The other two output modes should not be mixed with data according to
“context” information.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
See also:
[PATCH net-next 1/2] scripts/coccinelle: Find PTR_ERR() to %pe candidates
https://lore.kernel.org/cocci/7d46a1d1-f205-4751-9f7d-6a219be04801@nvidia.com/
scripts/coccinelle/misc/ptr_err_to_pe.cocci | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/scripts/coccinelle/misc/ptr_err_to_pe.cocci b/scripts/coccinelle/misc/ptr_err_to_pe.cocci
index f0bd658c7edb..fa93a6f2e3d2 100644
--- a/scripts/coccinelle/misc/ptr_err_to_pe.cocci
+++ b/scripts/coccinelle/misc/ptr_err_to_pe.cocci
@@ -12,13 +12,20 @@
virtual context, report, org
-@r@
+@...ends on context@
+expression ptr;
+constant char[] fmt;
+identifier print_func;
+@@
+*print_func(..., fmt, ..., PTR_ERR(ptr), ...)
+
+@r depends on org || report@
expression ptr;
constant char[] fmt;
position p;
identifier print_func;
@@
-*print_func(..., fmt, ..., PTR_ERR@p(ptr), ...)
+ print_func(..., fmt, ..., PTR_ERR@p(ptr), ...)
@script:python depends on report@
p << r.p;
--
2.51.0
Powered by blists - more mailing lists