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_lo{w}_hi{gh}() replacements

As other rules done, we add rules for str_lo{w}_hi{gh}()
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
5b7ca450 d4c75440

+38
+38
scripts/coccinelle/api/string_choices.cocci
··· 165 165 @@ 166 166 167 167 coccilib.report.print_report(p[0], "opportunity for str_high_low(%s)" % e) 168 + 169 + @str_lo_hi depends on patch@ 170 + expression E; 171 + @@ 172 + - ((E) ? "lo" : "hi") 173 + + str_lo_hi(E) 174 + 175 + @str_lo_hi_r depends on !patch exists@ 176 + expression E; 177 + position P; 178 + @@ 179 + * ((E@P) ? "lo" : "hi") 180 + 181 + @script:python depends on report@ 182 + p << str_lo_hi_r.P; 183 + e << str_lo_hi_r.E; 184 + @@ 185 + 186 + coccilib.report.print_report(p[0], "opportunity for str_lo_hi(%s)" % e) 187 + 188 + @str_low_high depends on patch@ 189 + expression E; 190 + @@ 191 + - ((E) ? "low" : "high") 192 + + str_low_high(E) 193 + 194 + @str_low_high_r depends on !patch exists@ 195 + expression E; 196 + position P; 197 + @@ 198 + * ((E@P) ? "low" : "high") 199 + 200 + @script:python depends on report@ 201 + p << str_low_high_r.P; 202 + e << str_low_high_r.E; 203 + @@ 204 + 205 + coccilib.report.print_report(p[0], "opportunity for str_low_high(%s)" % e)