From: elfring@users.sourceforge.net (SF Markus Elfring)
To: cocci@systeme.lip6.fr
Subject: [Cocci] Comparing statement lists with SmPL
Date: Tue, 22 Aug 2017 11:19:02 +0200 [thread overview]
Message-ID: <fda11784-5ed9-33ae-7beb-b5714abb11bc@users.sourceforge.net> (raw)
In-Reply-To: <alpine.DEB.2.20.1708172130300.2068@hadrien>
>> * Are there further development challenges to consider for the safe identification
>> of unique statements by metavariables?
>
> If you want to ensure that two metavariables match things
> in different places, then put a position variable on each match
> and use apython rule afterwards to discard the occurrences that
> are both in the same position.
I imagine that such an approach can only matter if there will be
several SmPL rules involved.
I have tried another variant out for a source code analysis.
@duplicated_code@
identifier work;
statement s1, s2;
type T;
@@
T work(...)
{
<+...
*if ((...) < 0)
*{
...
* s1
* s2
*}
...+>
<+...
*if ((...) < 0)
*{
...
* s1
* s2
*}
...+>
}
elfring at Sonne:~/Projekte/Linux/next-patched> XX=$(date) && spatch.opt -timeout 34 -j 4 --chunksize 1 --sp-file ~/Projekte/Coccinelle/janitor/show_same_statements3.cocci --dir sound > ~/Projekte/Bau/Linux/scripts/Coccinelle/tuning1/next/20170803/same_statements3+.diff 2> ~/Projekte/Bau/Linux/scripts/Coccinelle/tuning1/next/20170803/same_statements3+-errors.txt; YY=$(date) && echo "$XX | $YY"
Di 22. Aug 10:24:47 CEST 2017 | Di 22. Aug 10:26:04 CEST 2017
Now I find that a test result like the following is worth for further
development considerations.
?
--- sound/usb/6fire/firmware.c
+++ /tmp/nothing/usb/6fire/firmware.c
@@ -246,14 +246,8 @@ static int usb6fire_fw_ezusb_upload(
while (usb6fire_fw_ihex_next_record(rec)) { /* write firmware */
ret = usb6fire_fw_ezusb_write(device, 0xa0, rec->address,
rec->data, rec->len);
- if (ret < 0) {
kfree(rec);
release_firmware(fw);
- dev_err(&intf->dev,
- "unable to upload ezusb firmware %s: data urb.\n",
- fwname);
- return ret;
- }
}
release_firmware(fw);
@@ -319,13 +313,8 @@ static int usb6fire_fw_fpga_upload(
buffer[i] = bitrev8((u8)*c);
ret = usb6fire_fw_fpga_write(device, buffer, i);
- if (ret < 0) {
release_firmware(fw);
kfree(buffer);
- dev_err(&intf->dev,
- "unable to upload fpga firmware: fw urb.\n");
- return ret;
- }
}
release_firmware(fw);
kfree(buffer);
?
How would you like to treat variations in such log messages?
Regards,
Markus
next prev parent reply other threads:[~2017-08-22 9:19 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
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 [this message]
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=fda11784-5ed9-33ae-7beb-b5714abb11bc@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--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.