Skip to contentSkip to conversation

checkpatch: improve 'bare use of' signed/unsigned types warning

PATCH New [email protected] 1 participant 1 message Aug 2, 2016 Checkpatch

lore
Share & tools
lore
#0 lore raw

PATCH 54/111 checkpatch: improve 'bare use of' signed/unsigned types warning

From: Joe Perches <[email protected]>
Subject: checkpatch: improve 'bare use of' signed/unsigned types warning

Fix false positive warning of identifiers ending in signed with an = assignment of WARNING: Prefer 'signed int' to bare use of 'signed'.

---

 scripts/checkpatch.pl |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl renamed from scripts/checkpatch.pl~checkpatch-improve-bare-use-of-signed-unsigned-types-warning +1 -1
diff -puN scripts/checkpatch.pl~checkpatch-improve-bare-use-of-signed-unsigned-types-warning scripts/checkpatch.pl
@@ -3347,7 +3347,7 @@ sub process {
 		next if ($line =~ /^[^\+]/);
 
 # check for declarations of signed or unsigned without int
-		while ($line =~ m{($Declare)\s*(?!char\b|short\b|int\b|long\b)\s*($Ident)?\s*[=,;\[\)\(]}g) {
+		while ($line =~ m{\b($Declare)\s*(?!char\b|short\b|int\b|long\b)\s*($Ident)?\s*[=,;\[\)\(]}g) {
 			my $type = $1;
 			my $var = $2;
 			$var = "" if (!defined $var);

_