check patch: ABI warning only once per file, not once per line

Stop drowning and missing other warnings.

Example:

 ./scripts/checkpatch.pl -g eaf49e26b4bb~0

- 40 "Please update ABI..." warnings
- 2 other warnings including a spelling mistake that were missed.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This commit is contained in:
Marc Herbert 2020-07-09 15:00:49 -07:00 committed by Liam Girdwood
parent e51df282a4
commit 318dc9f7e1
1 changed files with 3 additions and 1 deletions

View File

@ -2309,6 +2309,7 @@ sub process {
my $commit_log_has_diff = 0; my $commit_log_has_diff = 0;
my $reported_maintainer_file = 0; my $reported_maintainer_file = 0;
my $reported_abi_update = 0; my $reported_abi_update = 0;
my $last_abi_file = '';
my $non_utf8_charset = 0; my $non_utf8_charset = 0;
my $last_blank_line = 0; my $last_blank_line = 0;
@ -3321,10 +3322,11 @@ sub process {
} }
# UAPI ABI version # UAPI ABI version
if ($SOF && if ($SOF && $realfile ne $last_abi_file &&
$realfile =~ m@^(src/include/ipc/|src/include/kernel/|src/include/user/)@ && $realfile =~ m@^(src/include/ipc/|src/include/kernel/|src/include/user/)@ &&
$rawline =~ /^\+/ && $rawline =~ /^\+/ &&
!$reported_abi_update) { !$reported_abi_update) {
$last_abi_file = $realfile;
WARN("ABI update ??", WARN("ABI update ??",
"Please update ABI in accordance with http://semver.org\n" . $hereprev); "Please update ABI in accordance with http://semver.org\n" . $hereprev);
} }