summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorElyes Haouas <ehaouas@noos.fr>2022-07-13 17:05:19 +0200
committerMartin L Roth <gaumless@tutanota.com>2022-07-19 01:47:49 +0000
commitcb346842ad986c3ee6447efcfc77688c3b50ccce (patch)
tree29f74aea18ec168947c2181f65307770ad534890 /util
parente235a0de181d3b30ce7c3653350cd7d24ff1ea03 (diff)
downloadcoreboot-cb346842ad986c3ee6447efcfc77688c3b50ccce.tar.gz
coreboot-cb346842ad986c3ee6447efcfc77688c3b50ccce.tar.bz2
coreboot-cb346842ad986c3ee6447efcfc77688c3b50ccce.zip
lint/checkpatch: Update 'check for unwanted Gerrit info'
This reduce the difference with linux v5.19-rc7. Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Change-Id: I856bfa0f0d39fda549671b1029cccdc39f831bab Reviewed-on: https://review.coreboot.org/c/coreboot/+/65833 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin L Roth <gaumless@tutanota.com>
Diffstat (limited to 'util')
-rwxr-xr-xutil/lint/checkpatch.pl18
1 files changed, 14 insertions, 4 deletions
diff --git a/util/lint/checkpatch.pl b/util/lint/checkpatch.pl
index 2bc74eb65c7e..512aa43a7371 100755
--- a/util/lint/checkpatch.pl
+++ b/util/lint/checkpatch.pl
@@ -2449,6 +2449,7 @@ sub process {
my $is_patch = 0;
my $in_header_lines = $file ? 0 : 1;
my $in_commit_log = 0; #Scanning lines before patch
+ my $has_patch_separator = 0; #Found a --- line
my $has_commit_log = 0; #Encountered lines before patch
my $commit_log_possible_stack_dump = 0;
my $commit_log_long_line = 0;
@@ -2746,6 +2747,12 @@ sub process {
$in_commit_log = 0;
}
+# Check for patch separator
+ if ($line =~ /^---$/) {
+ $has_patch_separator = 1;
+ $in_commit_log = 0;
+ }
+
# Check if MAINTAINERS is being updated. If so, there's probably no need to
# emit the "does MAINTAINERS need updating?" message on file add/move/delete
if ($line =~ /^\s*MAINTAINERS\s*\|/) {
@@ -2829,10 +2836,13 @@ sub process {
"A patch subject line should describe the change not the tool that found it\n" . $herecurr);
}
-# Check for unwanted Gerrit info
- if ($in_commit_log && $line =~ /^\s*change-id:/i) {
- ERROR("GERRIT_CHANGE_ID",
- "Remove Gerrit Change-Id's before submitting upstream.\n" . $herecurr);
+# Check for Gerrit Change-Ids not in any patch context
+ if ($realfile eq '' && !$has_patch_separator && $line =~ /^\s*change-id:/i) {
+ if (ERROR("GERRIT_CHANGE_ID",
+ "Remove Gerrit Change-Id's before submitting upstream\n" . $herecurr) &&
+ $fix) {
+ fix_delete_line($fixlinenr, $rawline);
+ }
}
# Check if the commit log is in a possible stack dump