All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Julia Lawall <julia.lawall@inria.fr>, cocci@inria.fr
Subject: Re: [cocci] Searching for selected variable assignments (with SmPL)?
Date: Sat, 6 Sep 2025 12:25:36 +0200	[thread overview]
Message-ID: <ce7a7254-bbb3-4666-8a57-2e6cccaa51fc@web.de> (raw)
In-Reply-To: <13ed7845-6fd9-4a8e-9670-3d2b7e7a0f4e@web.de>

> We might not be able to continue a search directly after a known source code position.
> But I assume that it would be possible to direct a search repetition to the place
> which was determined before (according to a semicolon for example).

The initially mentioned SmPL script pointed the implementation of the function “arm_dt_init_cpu_maps”
(besides others) for further development considerations.
https://elixir.bootlin.com/linux/v6.17-rc4/source/arch/arm/kernel/devtree.c#L59-L165

I tried also the following SmPL script variant out.


@find@
expression e;
position place;
type t;
t * pointer;
@@
 pointer = e(...);@place

@display@
position find.place;
statement s;
type find.t;
t * find.pointer;
@@
*;@place
 if (!pointer)
    s
 ... when != pointer


Unfortunately, it does not present the known implementation details.

Questionable test result:
Markus_Elfring@Sonne:…/Projekte/Linux/next-analyses> /usr/bin/spatch --no-loops …/Projekte/Coccinelle/janitor/show_unused_addresses_from_variable_assignments.cocci arch/arm/kernel/devtree.c
…
[no diff output]


I would appreciate corresponding software improvements.

Regards,
Markus

  reply	other threads:[~2025-09-06 10:25 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-04 12:36 [cocci] Searching for missing cleanup function calls (with SmPL)? Markus Elfring
2025-09-04 12:43 ` Julia Lawall
2025-09-04 12:58   ` Markus Elfring
2025-09-12  9:29   ` Markus Elfring
2025-09-12 11:07     ` Julia Lawall
2025-09-12 12:30       ` Markus Elfring
2025-09-12 13:43     ` Markus Elfring
2025-09-12 15:43   ` Markus Elfring
2025-09-06  8:00 ` [cocci] Searching for selected variable assignments " Markus Elfring
2025-09-06  8:07   ` Julia Lawall
2025-09-06  8:10     ` Markus Elfring
2025-09-06  8:22       ` Julia Lawall
2025-09-06  9:11         ` Markus Elfring
2025-09-06  9:14           ` Julia Lawall
2025-09-06  9:28             ` Markus Elfring
2025-09-06 10:25               ` Markus Elfring [this message]
2025-09-06 11:12                 ` Julia Lawall
2025-09-06 12:07                   ` Markus Elfring
2025-09-06 12:13                     ` Julia Lawall
2025-09-06 12:30                       ` Markus Elfring
2025-09-06 12:36                         ` Julia Lawall
2025-09-06 12:47                           ` Markus Elfring
2025-09-06 12:51                             ` Julia Lawall
2025-09-06 13:20     ` Markus Elfring
2025-09-08  6:15       ` Markus Elfring

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=ce7a7254-bbb3-4666-8a57-2e6cccaa51fc@web.de \
    --to=markus.elfring@web.de \
    --cc=cocci@inria.fr \
    --cc=julia.lawall@inria.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.