Skip to content

Commit 2fe0366

Browse files
authored
Merge pull request #844 from ojeda/checkpatch
scripts: checkpatch: use `elsif` and make `%pA` an `ERROR`
2 parents 828d03c + 92580b0 commit 2fe0366

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

scripts/checkpatch.pl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6782,19 +6782,19 @@ sub process {
67826782
}
67836783
if ($bad_specifier ne "") {
67846784
my $stat_real = get_stat_real($linenr, $lc);
6785+
my $msg_level = \&WARN;
67856786
my $ext_type = "Invalid";
67866787
my $use = "";
6787-
if ($bad_specifier =~ /pA/) {
6788-
ERROR("VSPRINTF_RUST",
6789-
"'\%pA' is only intended to be used from Rust code\n" . "$here\n$stat_real\n");
6790-
}
67916788
if ($bad_specifier =~ /p[Ff]/) {
67926789
$use = " - use %pS instead";
67936790
$use =~ s/pS/ps/ if ($bad_specifier =~ /pf/);
6791+
} elsif ($bad_specifier =~ /pA/) {
6792+
$use = " - '%pA' is only intended to be used from Rust code";
6793+
$msg_level = \&ERROR;
67946794
}
67956795

6796-
WARN("VSPRINTF_POINTER_EXTENSION",
6797-
"$ext_type vsprintf pointer extension '$bad_specifier'$use\n" . "$here\n$stat_real\n");
6796+
&{$msg_level}("VSPRINTF_POINTER_EXTENSION",
6797+
"$ext_type vsprintf pointer extension '$bad_specifier'$use\n" . "$here\n$stat_real\n");
67986798
}
67996799
}
68006800
}

0 commit comments

Comments
 (0)