diff options
author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-10-01 12:15:47 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-10-01 12:27:28 +0300 |
commit | c602f29dd17cad0ccbe943052be2d10c64911b60 (patch) | |
tree | ed20f7a51835dc423ed54f23a4f0f212eb8457b5 /tools/perf/scripts/python/exported-sql-viewer.py | |
parent | 209ecc56aa22912a15a61919393e36a31b5c5501 (diff) | |
download | linux-c602f29dd17cad0ccbe943052be2d10c64911b60.tar.xz |
media: zoran: fix mixed case on vars
Use this small script to replace CamelCase and wrong case
on vars:
<script>
FILES=$(find "$1" -type f|grep -e '.c$' -e '.h$')
CAMEL_VARS=$(cat tags|perl -ne 'print "$1\n" if (m/^(\w*[A-Z]\w*[a-z]\w*)\s/)')
for i in $CAMEL_VARS; do
new=$(perl -e '
my $s = $ARGV[0];
$s =~ s{([^a-zA-Z]?)([A-Z]*)([A-Z])([a-z]?)}{
my $fc = pos($s)==0;
my ($p0,$p1,$p2,$p3) = ($1,lc$2,lc$3,$4);
my $t = $p0 || $fc ? $p0 : '_';
$t .= $p3 ? $p1 ? "${p1}_$p2$p3" : "$p2$p3" : "$p1$p2";
$t;
}ge;
print $s;' "$i")
for j in $FILES; do
sed -E "s,\b$i\b,$new,g" -i $j
done
done
for i in $(git grep "#define zr" drivers/staging/media/zoran/*.[ch]|perl -ne 'print "$1\n" if (m/#define\s+(zr\S+)/)'); do j=$(echo $i|tr [a-z] [A-Z]); sed "s,\b$i\b,$j,g" -i drivers/staging/media/zoran/*.[ch]; done
</script>
This should solve almost all warnings reported by checkpatch.pl
in strict mode.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions