diff mbox

[PATCHv2] checkpatch: remove cunit warnings

Message ID 1415988822-913-1-git-send-email-maxim.uvarov@linaro.org
State New
Headers show

Commit Message

Maxim Uvarov Nov. 14, 2014, 6:13 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>
---
 v2: added \b to match beginning of the word. So that if we will
     have ODP_CU_something warning will appear. (Thanks Mike).

Maxim.

 scripts/checkpatch.pl | 3 +++
 1 file changed, 3 insertions(+)
diff mbox

Patch

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index b954de5..f813e5b 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2937,10 +2937,13 @@  sub process {
 #CamelCase
 		while ($line =~ m{($Constant|$Lval)}g) {
 			my $var = $1;
+
 			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",
 				     "Avoid CamelCase: <$var>\n" . $herecurr);