From: Julia Lawall <julia.lawall@inria.fr>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: Coccinelle <cocci@systeme.lip6.fr>
Subject: Re: [Cocci] Checking search results for two enumerations
Date: Thu, 30 Apr 2020 19:16:17 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.21.2004301913110.13683@hadrien> (raw)
In-Reply-To: <3069d2ed-475d-d36f-526e-4b7a685577cb@web.de>
[-- Attachment #1: Type: text/plain, Size: 1687 bytes --]
On Thu, 30 Apr 2020, Markus Elfring wrote:
> Hello,
>
> I have tried another tiny script out for the semantic patch language
> (according to the software combination “Coccinelle 1.0.8-00029-ga549b9f0”).
>
>
> @display@
> int i;
> @@
> return
> * -i
> ;
>
>
> Are the following search results worth for further software development considerations?
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/drivers/net/wireless/intersil/hostap/hostap_main.c
>
> elfring@Sonne:~/Projekte/Linux/next-patched> spatch ~/Projekte/Coccinelle/janitor/show_returns_of_negative_integers2.cocci drivers/net/wireless/intersil/hostap/hostap_main.c
> …
> @@ -328,7 +327,6 @@ int hostap_set_encryption(local_info_t *
> u16 val, old_val;
> int i, keylen, len, idx;
> char keybuf[WEP_KEY_LEN + 1];
> - enum { NONE, WEP, OTHER } encrypt_type;
>
> idx = local->crypt_info.tx_keyidx;
> if (local->crypt_info.crypt[idx] == NULL ||
> …
>
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/sound/drivers/opl3/opl3_midi.c
>
> elfring@Sonne:~/Projekte/Linux/next-patched> spatch ~/Projekte/Coccinelle/janitor/show_returns_of_negative_integers2.cocci sound/drivers/opl3/opl3_midi.c
> …
> @@ -136,7 +136,6 @@ static int opl3_get_voice(struct snd_opl
>
> /* This is our "allocation cost" table */
> enum {
> - FREE = 0, CHEAP, EXPENSIVE, END
> };
>
> /* Keeps track of what we are finding */
> …
>
>
> Why are source code places presented which do not contain a key word
> I was looking for this test approach?
I don't know. With --debug you can see that there are only two matches.
So maybe it is a pretty printing problem.
julia
[-- Attachment #2: Type: text/plain, Size: 136 bytes --]
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci
next prev parent reply other threads:[~2020-04-30 17:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-30 17:06 [Cocci] Checking search results for two enumerations Markus Elfring
2020-04-30 17:16 ` Julia Lawall [this message]
2020-05-01 5:15 ` [Cocci] Checking SmPL data processing for enumerations 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.21.2004301913110.13683@hadrien \
--to=julia.lawall@inria.fr \
--cc=Markus.Elfring@web.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).