public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Gal Pressman <gal@nvidia.com>
To: Markus Elfring <Markus.Elfring@web.de>,
	Tariq Toukan <tariqt@nvidia.com>,
	cocci@inria.fr, Alexei Lazar <alazar@nvidia.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Julia Lawall <Julia.Lawall@inria.fr>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	Leon Romanovsky <leon@kernel.org>, Mark Bloch <mbloch@nvidia.com>,
	Nicolas Palix <nicolas.palix@imag.fr>,
	Richard Cochran <richardcochran@gmail.com>,
	Saeed Mahameed <saeedm@nvidia.com>
Subject: Re: [cocci] [PATCH net-next 1/2] scripts/coccinelle: Find PTR_ERR() to %pe candidates
Date: Sun, 28 Sep 2025 14:40:19 +0300	[thread overview]
Message-ID: <48228618-083b-4cdb-b7df-aa9b7ff0ce92@nvidia.com> (raw)
In-Reply-To: <48a8dbb8-adf1-475e-897d-7369e2c3f6eb@web.de>

Hi Markus!

Thanks for the review, forgive for being a total noob at coccinelle,
hence the many questions.

On 25/09/2025 18:07, Markus Elfring wrote:
> …> The script supports context, report, and org modes.
> 
> I suggest to omit this sentence from the description.
> 
> 
> Will the hint “scripts/” be omitted from the patch prefix?

The patch was merged already, so I'm skipping to comments that can be
fixed in a followup patch.

> 
> 
> …> +++ b/scripts/coccinelle/misc/ptr_err_to_pe.cocci
> …> +// URL: https://coccinelle.gitlabpages.inria.fr/website
> 
> I suggest to omit this comment line.

Sure.

> 
> 
> …> +virtual context
>> +virtual org
>> +virtual report
> 
> The restriction on the support for three operation modes will need further development considerations.

I don't understand what you mean?

> 
> 
>> +@r@
>> +expression ptr;
>> +constant fmt;
>> +position p;
>> +identifier print_func;
>> +@@
>> +* print_func(..., fmt, ..., PTR_ERR@p(ptr), ...)
> 
> How do you think about to use the metavariable type “format list”?

I did find "format list" in the documentation, but spatch fails when I
try to use it.

> 
> Would it matter to restrict expressions to pointer expressions?

I tried changing 'expression ptr;' -> 'expression *ptr;', but then it
didn't find anything. Am I doing it wrong?

> 
> 
>> +@script:python depends on r && org@
> 
> I guess that such an SmPL dependency specification can be simplified a bit.

You mean drop the depends on r?

> 
> 
>> +p << r.p;
>> +@@
>> +coccilib.org.print_todo(p[0], "WARNING: Consider using %pe to print PTR_ERR()")
> 
> I suggest to reconsider the implementation detail once more
> if the SmPL asterisk functionality fits really to the operation modes “org” and “report”.
> 
> The operation mode “context” can usually work also without an extra position variable,
> can't it?

Can you please explain?

  reply	other threads:[~2025-09-28 11:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-18 10:43 [PATCH net-next 0/2] scripts/coccinelle: Symbolic error names script Tariq Toukan
2025-09-18 10:43 ` [PATCH net-next 1/2] scripts/coccinelle: Find PTR_ERR() to %pe candidates Tariq Toukan
2025-09-19 16:54   ` Simon Horman
2025-09-22 23:36   ` Jakub Kicinski
2025-09-25 15:07   ` [cocci] " Markus Elfring
2025-09-28 11:40     ` Gal Pressman [this message]
2025-09-28 12:00       ` Markus Elfring
2025-09-28 13:24         ` Gal Pressman
2025-09-28 14:16           ` Markus Elfring
2025-09-28 16:40             ` Gal Pressman
2025-09-28 17:51               ` [cocci] [1/2] " Markus Elfring
2025-09-28 12:23       ` [cocci] [PATCH net-next 1/2] " Julia Lawall
2025-09-28 13:17         ` Gal Pressman
2025-09-18 10:43 ` [PATCH net-next 2/2] net/mlx5: Use %pe format specifier for error pointers Tariq Toukan
2025-09-19 16:55   ` Simon Horman
2025-09-26 19:50 ` [PATCH net-next 0/2] scripts/coccinelle: Symbolic error names script patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48228618-083b-4cdb-b7df-aa9b7ff0ce92@nvidia.com \
    --to=gal@nvidia.com \
    --cc=Julia.Lawall@inria.fr \
    --cc=Markus.Elfring@web.de \
    --cc=alazar@nvidia.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=cocci@inria.fr \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mbloch@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.palix@imag.fr \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox