All of lore.kernel.org
 help / color / mirror / Atom feed
From: julia.lawall@lip6.fr (Julia Lawall)
To: cocci@systeme.lip6.fr
Subject: [Cocci] Comparing statement lists with SmPL
Date: Tue, 15 Aug 2017 22:09:11 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1708152208320.2049@hadrien> (raw)
In-Reply-To: <76e2fbf5-4812-18eb-2968-53019d97ab14@users.sourceforge.net>



On Tue, 15 Aug 2017, SF Markus Elfring wrote:

> > The source code analysis results look promising by this command.
>
> I have just noticed that an other source file points details out for further
> development considerations around the mentioned functionality from the
> Coccinelle software.
>
> elfring at Sonne:~/Projekte/Linux/next-patched> git checkout next-20170803 && spatch.opt ~/Projekte/Coccinelle/janitor/show_same_statements1.cocci sound/pci/rme9652/hdspm.c
> ?
>      (ONCE) already tagged but only removed, so safe
> diff =
> ?
> @@ -6497,9 +6497,6 @@ static int snd_hdspm_create_alsa_devices
>  	i = 0;
>  	while (i < hdspm->midiPorts) {
>  		err = snd_hdspm_create_midi(card, hdspm, i);
> -		if (err < 0) {
> -			return err;
> -		}
>  		i++;
>  	}
>
> @@ -6955,10 +6952,6 @@ static int snd_hdspm_probe(struct pci_de
>  	hdspm->pci = pci;
>
>  	err = snd_hdspm_create(card, hdspm);
> -	if (err < 0) {
> -		snd_card_free(card);
> -		return err;
> -	}
>
>  	if (hdspm->io_type != MADIface) {
>  		snprintf(card->shortname, sizeof(card->shortname), "%s_%x",
> ?
>
>
> Now I am looking for a way to express the constraint that the statement list
> metavariable should match only source code with two statements at least.
> Can the search for duplicated source code be improved by the means of the
> semantic patch language?

For two statements at least you could do:

(
{
s1
s2
...
}
&
{
sl
}
)

julia

  reply	other threads:[~2017-08-15 20:09 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-15 17:26 [Cocci] Comparing statement lists with SmPL SF Markus Elfring
2017-08-15 17:33 ` Julia Lawall
2017-08-15 19:04   ` SF Markus Elfring
2017-08-15 19:09     ` Julia Lawall
2017-08-15 19:14       ` SF Markus Elfring
2017-08-15 20:00     ` SF Markus Elfring
2017-08-15 20:09       ` Julia Lawall [this message]
2017-08-15 20:15         ` SF Markus Elfring
2017-08-16  6:48         ` SF Markus Elfring
2017-08-16  7:03           ` SF Markus Elfring
2017-08-16  9:20             ` Julia Lawall
2017-08-16 10:42               ` SF Markus Elfring
2017-08-16  9:01           ` Julia Lawall
2017-08-16  7:35         ` SF Markus Elfring
2017-08-17 17:54           ` SF Markus Elfring
2017-08-17 18:44             ` Julia Lawall
2017-08-17 19:26               ` SF Markus Elfring
2017-08-17 19:31                 ` Julia Lawall
2017-08-17 19:43                   ` SF Markus Elfring
2017-08-22  9:19                   ` SF Markus Elfring
2017-08-22  9:28                     ` Julia Lawall
2017-08-22 10:00                       ` SF Markus Elfring
     [not found]                         ` <alpine.DEB.2.20.1708221202380.3178@hadrien>
2017-08-22 10:12                           ` SF Markus Elfring
2017-08-22 10:15                             ` Julia Lawall
2017-08-22 10:20                               ` SF Markus Elfring
     [not found]                                 ` <alpine.DEB.2.20.1708221221260.3178@hadrien>
2017-08-22 10:33                                   ` SF Markus Elfring
2017-08-23 14:43                     ` SF Markus Elfring
     [not found]                       ` <alpine.DEB.2.20.1708231644340.3150@hadrien>
2017-08-23 15:39                         ` SF Markus Elfring
     [not found]                           ` <alpine.DEB.2.20.1708231742480.3150@hadrien>
2017-08-23 15:50                             ` SF Markus Elfring
2017-08-24  7:56                             ` SF Markus Elfring
2017-08-16  6:10   ` SF Markus Elfring
2017-08-16  6:26     ` Julia Lawall
2017-08-16  6:38       ` SF 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=alpine.DEB.2.20.1708152208320.2049@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=cocci@systeme.lip6.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.