@@ -7020,15 +7020,17 @@ sub process {
}
}
-# 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);
+# check for #defines like: 1 << <digit> that could be BIT(digit) or similar
+ if ($line =~ /#\s*define\s+\w+\s+\(?\s*1\s*([ulUL]*)\s*\<\<\s*(?:\d+|$Ident)\s*\)?/) {
+ my $ull = (defined($1) && $1 =~ /ll/i);
+ my $macroname = $ull ? "BIT_ULL" : "BIT";
+ if ($realfile =~ m@include/uapi/@) {
+ $macroname = $ull ? "_BITULL" : "_BITUL";
+ }
if (CHK("BIT_MACRO",
- "Prefer using the BIT$ull macro\n" . $herecurr) &&
+ "Prefer using the $macroname macro\n" . $herecurr) &&
$fix) {
- $fixed[$fixlinenr] =~ s/\(?\s*1\s*[ulUL]*\s*<<\s*(\d+|$Ident)\s*\)?/BIT${ull}($1)/;
+ $fixed[$fixlinenr] =~ s/\(?\s*1\s*[ulUL]*\s*<<\s*(\d+|$Ident)\s*\)?/${macroname}($1)/;
}
}