mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@inria.fr>
To: Nishanth Menon <nm@ti.com>
Cc: Nicolas Palix <nicolas.palix@imag.fr>,
	linux-kernel@vger.kernel.org, cocci@inria.fr,
	Kirill Smelkov <kirr@nexedi.com>
Subject: Re: [PATCH] coccinelle: api/stream_open: Introduce metavariables for checks
Date: Tue, 5 Apr 2022 08:17:56 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2204050816560.2185@hadrien> (raw)
In-Reply-To: <20220404215926.14811-1-nm@ti.com>



On Mon, 4 Apr 2022, Nishanth Menon wrote:

> Coccinelle spatch version 1.1.1 reports the following:
> warning: line 134: should no_llseek be a metavariable?
> warning: line 141: should noop_llseek be a metavariable?
> warning: line 223: should nonseekable_open be a metavariable?
> warning: line 290: should nonseekable_open be a metavariable?
> warning: line 338: should nonseekable_open be a metavariable?
>
> So, introduce the metavariable similar to other check instances.

This changes the semantic from matching the specific thing to anything.
So are you sure that it is what is wanted?  If it should always be the
specific thing, then you can get rid of the warning using eg symbol
no_llseek.

julia

>
> Signed-off-by: Nishanth Menon <nm@ti.com>
> ---
>
> NOTE: This is currently reported in next-20220404, though I have'nt
> bisected for exact fixes tags to be used.
>
>  scripts/coccinelle/api/stream_open.cocci | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/scripts/coccinelle/api/stream_open.cocci b/scripts/coccinelle/api/stream_open.cocci
> index df00d6619b06..d33732f35710 100644
> --- a/scripts/coccinelle/api/stream_open.cocci
> +++ b/scripts/coccinelle/api/stream_open.cocci
> @@ -129,6 +129,7 @@ identifier llseek_f;
>
>  @ has_no_llseek @
>  identifier fops0.fops;
> +identifier no_llseek;
>  @@
>    struct file_operations fops = {
>      .llseek = no_llseek,
> @@ -136,6 +137,7 @@ identifier fops0.fops;
>
>  @ has_noop_llseek @
>  identifier fops0.fops;
> +identifier noop_llseek;
>  @@
>    struct file_operations fops = {
>      .llseek = noop_llseek,
> @@ -216,6 +218,7 @@ identifier stream_writer.writestream;
>
>  @ report_rw depends on report @
>  identifier fops_rw.openfunc;
> +identifier nonseekable_open;
>  position p1;
>  @@
>    openfunc(...) {
> @@ -283,6 +286,7 @@ identifier stream_reader.readstream;
>
>  @ report_r depends on report @
>  identifier fops_r.openfunc;
> +identifier nonseekable_open;
>  position p1;
>  @@
>    openfunc(...) {
> @@ -331,6 +335,7 @@ identifier stream_writer.writestream;
>
>  @ report_w depends on report @
>  identifier fops_w.openfunc;
> +identifier nonseekable_open;
>  position p1;
>  @@
>    openfunc(...) {
> --
> 2.31.1
>
>

  reply	other threads:[~2022-04-05  6:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-04 21:59 Nishanth Menon
2022-04-05  6:17 ` Julia Lawall [this message]
2022-04-05 12:34   ` Nishanth Menon

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=alpine.DEB.2.22.394.2204050816560.2185@hadrien \
    --to=julia.lawall@inria.fr \
    --cc=cocci@inria.fr \
    --cc=kirr@nexedi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.palix@imag.fr \
    --cc=nm@ti.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

all inboxes | Powered by JetHome®