From: LABBE Corentin <clabbe@baylibre.com>
To: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
linuxarm@huawei.com, mauro.chehab@huawei.com,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
mjpeg-users@lists.sourceforge.net
Subject: Re: [PATCH 3/3] media: zoran: fix mixed case on vars
Date: Fri, 2 Oct 2020 09:21:15 +0200 [thread overview]
Message-ID: <20201002072115.GC15586@Red> (raw)
In-Reply-To: <5e09ed2cc5cacfac0653089fc976be3409f0fa9d.1601544491.git.mchehab+huawei@kernel.org>
On Thu, Oct 01, 2020 at 11:28:15AM +0200, Mauro Carvalho Chehab wrote:
> 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>
> ---
> drivers/staging/media/zoran/videocodec.h | 2 +-
> drivers/staging/media/zoran/zoran.h | 30 +--
> drivers/staging/media/zoran/zoran_card.c | 52 ++---
> drivers/staging/media/zoran/zoran_device.c | 242 ++++++++++-----------
> drivers/staging/media/zoran/zoran_driver.c | 94 ++++----
> drivers/staging/media/zoran/zr36016.c | 14 +-
> drivers/staging/media/zoran/zr36050.c | 2 +-
> drivers/staging/media/zoran/zr36057.h | 122 +++++------
> drivers/staging/media/zoran/zr36060.c | 76 +++----
> drivers/staging/media/zoran/zr36060.h | 66 +++---
> 10 files changed, 350 insertions(+), 350 deletions(-)
Acked-by: Corentin Labbe <clabbe@baylibre.com>
Thanks
prev parent reply other threads:[~2020-10-02 7:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-01 9:28 [PATCH 1/3] media: zoran: use upper case for card types Mauro Carvalho Chehab
2020-10-01 9:28 ` [PATCH 2/3] media: zoran: get rid of an unused var Mauro Carvalho Chehab
2020-10-02 7:19 ` LABBE Corentin
2020-10-01 9:28 ` [PATCH 3/3] media: zoran: fix mixed case on vars Mauro Carvalho Chehab
2020-10-02 7:21 ` LABBE Corentin [this message]
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=20201002072115.GC15586@Red \
--to=clabbe@baylibre.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=mauro.chehab@huawei.com \
--cc=mchehab+huawei@kernel.org \
--cc=mchehab@kernel.org \
--cc=mjpeg-users@lists.sourceforge.net \
/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).