diff mbox

[PATCHv3] checkpatch: remove cunit warnings

Message ID 1415988967-1113-1-git-send-email-maxim.uvarov@linaro.org
State Accepted
Commit 4d055711a6df2817c8106b7678f7148f9ca0355c
Headers show

Commit Message

Maxim Uvarov Nov. 14, 2014, 6:16 p.m. UTC
CUnit names all it's functions with CU_. For check patch is
is camelcase, which is not proper odp syntax. This patch
turns off camelcase warnings for functions/types beginning
with CU_.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 scripts/checkpatch.pl | 1 +
 1 file changed, 1 insertion(+)

Comments

Mike Holmes Nov. 14, 2014, 6:34 p.m. UTC | #1
On 14 November 2014 13:16, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> CUnit names all it's functions with CU_. For check patch is
> is camelcase, which is not proper odp syntax. This patch
> turns off camelcase warnings for functions/types beginning
> with CU_.
>
> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
>

Reviewed-by: Mike Holmes <mike.holmes@linaro.org>

I like the functionality this provides, ZERO checkpatch warnings for your
unit test means your patch is good to be posted, currently you need to
parse it with your eyes to see if you generated the camelcase error or it
is was cunit code and unavoidable.
I can agree there may be better ways to get that behaviour but I think this
is ok though 1.0 to expedite our progress.

Mike



> ---
>  scripts/checkpatch.pl | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index b954de5..57d0a24 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -2940,6 +2940,7 @@ sub process {
>                         if ($var !~ /$Constant/ &&
>                             $var =~ /[A-Z]\w*[a-z]|[a-z]\w*[A-Z]/ &&
>                             $var !~
> /"^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ &&
> +                           $var !~ /\bCU_/ &&
>                             !defined $camelcase{$var}) {
>                                 $camelcase{$var} = 1;
>                                 WARN("CAMELCASE",
> --
> 1.8.5.1.163.gd7aced9
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
diff mbox

Patch

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index b954de5..57d0a24 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2940,6 +2940,7 @@  sub process {
 			if ($var !~ /$Constant/ &&
 			    $var =~ /[A-Z]\w*[a-z]|[a-z]\w*[A-Z]/ &&
 			    $var !~ /"^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ &&
+			    $var !~ /\bCU_/ &&
 			    !defined $camelcase{$var}) {
 				$camelcase{$var} = 1;
 				WARN("CAMELCASE",