Revert "checkpatch: update checkpatch to warn about C99 type usage"

Now that we are standardizing C99 integer types we can revert the commit
that warned about C99 type usage.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-06-02 12:38:11 -05:00 committed by Kumar Gala
commit 93da8dc478
2 changed files with 11 additions and 6 deletions

View file

@ -10,6 +10,7 @@
--ignore SPLIT_STRING --ignore SPLIT_STRING
--ignore VOLATILE --ignore VOLATILE
--ignore CONFIG_EXPERIMENTAL --ignore CONFIG_EXPERIMENTAL
--ignore PREFER_KERNEL_TYPES
--ignore AVOID_EXTERNS --ignore AVOID_EXTERNS
--ignore NETWORKING_BLOCK_COMMENT_STYLE --ignore NETWORKING_BLOCK_COMMENT_STYLE
--ignore DATE_TIME --ignore DATE_TIME

View file

@ -450,7 +450,7 @@ our $typeOtherOSTypedefs = qr{(?x:
u(?:nchar|short|int|long) # sysv u(?:nchar|short|int|long) # sysv
)}; )};
our $typeKernelTypedefs = qr{(?x: our $typeKernelTypedefs = qr{(?x:
(?:__)?(?:u|s|be|le)(?:8|16|32|64)_t| (?:__)?(?:u|s|be|le)(?:8|16|32|64)|
atomic_t atomic_t
)}; )};
our $typeTypedefs = qr{(?x: our $typeTypedefs = qr{(?x:
@ -5953,17 +5953,21 @@ sub process {
"Using weak declarations can have unintended link defects\n" . $herecurr); "Using weak declarations can have unintended link defects\n" . $herecurr);
} }
# check for c99 types like uint8_t # check for c99 types like uint8_t used outside of uapi/
if ($line =~ /\b($Declare)\s*$Ident\s*[=;,\[]/) { if ($realfile !~ m@\binclude/uapi/@ &&
$line =~ /\b($Declare)\s*$Ident\s*[=;,\[]/) {
my $type = $1; my $type = $1;
if ($type =~ /\b($typeC99Typedefs)\b/) { if ($type =~ /\b($typeC99Typedefs)\b/) {
$type = $1; $type = $1;
my $kernel_type = 'u'; my $kernel_type = 'u';
$kernel_type = 's' if ($type =~ /^_*[si]/); $kernel_type = 's' if ($type =~ /^_*[si]/);
$type =~ /(\d+)/; $type =~ /(\d+)/;
$kernel_type .= $1.'_t'; $kernel_type .= $1;
WARN("PREFER_KERNEL_TYPES", if (CHK("PREFER_KERNEL_TYPES",
"Prefer kernel type '$kernel_type' over '$type'\n" . $herecurr) "Prefer kernel type '$kernel_type' over '$type'\n" . $herecurr) &&
$fix) {
$fixed[$fixlinenr] =~ s/\b$type\b/$kernel_type/;
}
} }
} }