Skip to contentSkip to conversation

checkpatch: don't complain about BIT macro in uapi

PATCH Applied Tomas Winkler 2 participants 2 messages Jul 16, 2016 – Jul 19, 2016 Checkpatch

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 checkpatch: don't complain about BIT macro in uapi

BIT macro cannot be exported to UAPI, don't complain about it

---
V2: fix indentation

 scripts/checkpatch.pl | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
scripts/checkpatch.pl +3 -2
index a0e511206f24..76d3fccb82f3 100755
@@ -5733,8 +5733,9 @@ sub process {
 			}
 		}
 
-# check for #defines like: 1 << <digit> that could be BIT(digit)
-		if ($line =~ /#\s*define\s+\w+\s+\(?\s*1\s*([ulUL]*)\s*\<\<\s*(?:\d+|$Ident)\s*\)?/) {
+# check for #defines like: 1 << <digit> that could be BIT(digit), it is not exported to uapi
+		if ($realfile !~ m@^include/uapi/@ &&
+		    $line =~ /#\s*define\s+\w+\s+\(?\s*1\s*([ulUL]*)\s*\<\<\s*(?:\d+|$Ident)\s*\)?/) {
 			my $ull = "";
 			$ull = "_ULL" if (defined($1) && $1 =~ /ll/i);
 			if (CHK("BIT_MACRO",
Signature · 1 line
2.5.5
maintainer Acked-by on v2 1/1
#1 lore raw
Quoted 3 lines · Tomas Winkler

BIT macro cannot be exported to UAPI, don't complain about it

Andrew, can you please pick this up?

Quoted 21 lines

---
V2: fix indentation
 scripts/checkpatch.pl | 5 +++--

 1 file changed, 3 insertions(+), 2 deletions(-)
scripts/checkpatch.pl +0 -0
index a0e511206f24..76d3fccb82f3 100755
@@ -5733,8 +5733,9 @@ sub process {
  			}
  		}

scripts/checkpatch.pl +3 -2
-# check for #defines like: 1 <<  that could be BIT(digit)
-		if ($line =~ /#\s*define\s+\w+\s+\(?\s*1\s*([ulUL]*)\s*\<\<\s*(?:\d+|$Ident)\s*\)?/) {
+# check for #defines like: 1 <<  that could be BIT(digit), it is not exported to uapi
+		if ($realfile !~ m@^include/uapi/@ &&
+		    $line =~ /#\s*define\s+\w+\s+\(?\s*1\s*([ulUL]*)\s*\<\<\s*(?:\d+|$Ident)\s*\)?/) {

  my $ull = "";
  $ull = "_ULL" if (defined($1) && $1 =~ /ll/i); if (CHK("BIT_MACRO",