From: Markus Elfring <Markus.Elfring@web.de>
To: Wen Yang <wen.yang99@zte.com.cn>
Cc: Michal Marek <michal.lkml@markovi.net>,
linux-doc@vger.kernel.org, Nicolas Palix <nicolas.palix@imag.fr>,
linux-kernel@vger.kernel.org, cocci@systeme.lip6.fr
Subject: Re: [Cocci] Coccinelle: semantic patch for missing of_node_put
Date: Tue, 4 Jun 2019 13:28:39 +0200 [thread overview]
Message-ID: <9169c754-17ef-f820-8335-2015e3c37782@web.de> (raw)
In-Reply-To: <201906041350002807147@zte.com.cn>
> let add_function f c =
> if not (List.mem f !relevant_functions)
> then
> begin
> let s = String.concat " "
> (
> (List.map String.lowercase_ascii
> (List.filter
> (function x ->
> Str.string_match
> (Str.regexp "[a-zA-Z_\\(\\)][-a-zA-Z0-9_\\(\\)]*$")
> x 0) (Str.split (Str.regexp "[ .;\t\n]+") c)))) in
I would interpret one of these function calls in the way
that text splitting is performed here also for space characters
after a concatenation was performed.
> Printf.printf "comments: %s\n" s;
> if contains s relevant_str
> then
> Printf.printf "Found relevant function: %s\n" f;
> relevant_functions := f :: !relevant_functions;
> end
>
> @r@
> identifier fn;
> comments c;
> type T = struct device_node *;
> @@
>
> T@c fn(...) {
> ...
> }
>
> @script:ocaml@
> f << r.fn;
> c << r.c;
> @@
>
> let (cb,cm,ca) = List.hd c in
> let c = String.concat " " cb in
> add_function f c
Can an other data processing variant be more reasonable?
Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci
next prev parent reply other threads:[~2019-06-04 11:30 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <201905171432571474636@zte.com.cn>
2019-05-17 8:10 ` [Cocci] Coccinelle: semantic patch for missing of_node_put Markus Elfring
[not found] ` <alpine.DEB.2.20.1905170912590.4014@hadrien>
2019-05-17 8:22 ` Markus Elfring
[not found] ` <20190520093303.GA9320@atrey.karlin.mff.cuni.cz>
2019-05-20 9:52 ` Julia Lawall
2019-05-20 17:20 ` Sasha Levin
2019-05-20 19:53 ` Julia Lawall
2019-05-20 20:11 ` Markus Elfring
2019-05-18 14:43 ` Markus Elfring
2019-06-04 5:08 ` Markus Elfring
2019-06-04 5:50 ` wen.yang99
2019-06-04 6:36 ` Markus Elfring
2019-06-04 8:55 ` wen.yang99
2019-06-04 9:08 ` Markus Elfring
2019-06-04 11:28 ` Markus Elfring [this message]
2019-06-05 18:23 ` [Cocci] Coccinelle: Searching for “when done” in function comments Markus Elfring
2019-05-09 1:47 [Cocci] [PATCH] coccinelle: semantic patch for missing of_node_put wen.yang99
2019-05-09 8:10 ` [Cocci] Coccinelle: " 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=9169c754-17ef-f820-8335-2015e3c37782@web.de \
--to=markus.elfring@web.de \
--cc=cocci@systeme.lip6.fr \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.lkml@markovi.net \
--cc=nicolas.palix@imag.fr \
--cc=wen.yang99@zte.com.cn \
/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).