Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

coccinelle: Add rules to find str_read_write() replacements

As other rules done, we add rules for str_read_write()
to check the relative opportunities.

Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>

authored by

Hongbo Li and committed by
Julia Lawall
ba4b514a dd2275d3

+19
+19
scripts/coccinelle/api/string_choices.cocci
··· 241 241 @@ 242 242 243 243 coccilib.report.print_report(p[0], "opportunity for str_enabled_disabled(%s)" % e) 244 + 245 + @str_read_write depends on patch@ 246 + expression E; 247 + @@ 248 + - ((E) ? "read" : "write") 249 + + str_read_write(E) 250 + 251 + @str_read_write_r depends on !patch exists@ 252 + expression E; 253 + position P; 254 + @@ 255 + * ((E@P) ? "read" : "write") 256 + 257 + @script:python depends on report@ 258 + p << str_read_write_r.P; 259 + e << str_read_write_r.E; 260 + @@ 261 + 262 + coccilib.report.print_report(p[0], "opportunity for str_read_write(%s)" % e)