Skip to content

Commit

Permalink
Merge pull request torvalds#844 from ojeda/checkpatch
Browse files Browse the repository at this point in the history
scripts: checkpatch: use `elsif` and make `%pA` an `ERROR`
  • Loading branch information
ojeda authored Aug 1, 2022
2 parents 828d03c + 92580b0 commit 2fe0366
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -6782,19 +6782,19 @@ sub process {
}
if ($bad_specifier ne "") {
my $stat_real = get_stat_real($linenr, $lc);
my $msg_level = \&WARN;
my $ext_type = "Invalid";
my $use = "";
if ($bad_specifier =~ /pA/) {
ERROR("VSPRINTF_RUST",
"'\%pA' is only intended to be used from Rust code\n" . "$here\n$stat_real\n");
}
if ($bad_specifier =~ /p[Ff]/) {
$use = " - use %pS instead";
$use =~ s/pS/ps/ if ($bad_specifier =~ /pf/);
} elsif ($bad_specifier =~ /pA/) {
$use = " - '%pA' is only intended to be used from Rust code";
$msg_level = \&ERROR;
}

WARN("VSPRINTF_POINTER_EXTENSION",
"$ext_type vsprintf pointer extension '$bad_specifier'$use\n" . "$here\n$stat_real\n");
&{$msg_level}("VSPRINTF_POINTER_EXTENSION",
"$ext_type vsprintf pointer extension '$bad_specifier'$use\n" . "$here\n$stat_real\n");
}
}
}
Expand Down

0 comments on commit 2fe0366

Please sign in to comment.