cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Coccinelle <cocci@systeme.lip6.fr>
Subject: [Cocci] Checking search results for two enumerations
Date: Thu, 30 Apr 2020 19:06:12 +0200	[thread overview]
Message-ID: <3069d2ed-475d-d36f-526e-4b7a685577cb@web.de> (raw)

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?

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

             reply	other threads:[~2020-04-30 17:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-30 17:06 Markus Elfring [this message]
2020-04-30 17:16 ` [Cocci] Checking search results for two enumerations Julia Lawall
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=3069d2ed-475d-d36f-526e-4b7a685577cb@web.de \
    --to=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).