mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Marco Elver <elver@google.com>
Cc: Julia Lawall <Julia.Lawall@inria.fr>,
	Nicolas Palix <nicolas.palix@imag.fr>,
	linux-kernel@vger.kernel.org, cocci@inria.fr,
	kasan-dev@googlegroups.com
Subject: Re: [PATCH v2] coccinelle: locks: Add must_hold.cocci
Date: Fri, 20 Nov 2026 10:14:46 -0800	[thread overview]
Message-ID: <849463ae-c636-42ca-8cc2-667d84fea6fa@acm.org> (raw)
In-Reply-To: <20261120092646.3062639-1-elver@google.com>

On 11/20/26 1:26 AM, Marco Elver wrote:
> +ATTRS = re.compile(r'__(must_hold|must_hold_shared|releases|releases_shared|'
> +		   r'context_unsafe|no_context_analysis)\b')

Should __cond_acquires and __cond_releases be included in this
expression?

> +def missing_must_hold(f, a, E, pf, p):
> +	e = re.sub(r'\s+', '', E)

re.sub(r'\s+', '', E) turns (struct foo *)p into (structfoo*)p. Can this 
cause a silent false negative and garbled report text? Collapsing 
whitespace instead of removing it would keep tokens separate.

Additionally, missing_must_hold() re-reads the file, runs splitlines() 
on all of it and regex-scans it for every match. Has caching per file 
been considered? Would this help on a full-tree make coccicheck?

Thanks,

Bart.

      reply	other threads:[~2026-11-20 18:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20  9:26 Marco Elver
2026-11-20 18:14 ` Bart Van Assche [this message]

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=849463ae-c636-42ca-8cc2-667d84fea6fa@acm.org \
    --to=bvanassche@acm.org \
    --cc=Julia.Lawall@inria.fr \
    --cc=cocci@inria.fr \
    --cc=elver@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.palix@imag.fr \
    /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®