diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 9c4c4a61bc8327..b31f13d643a7f3 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -436,6 +436,7 @@ sub hash_show_words { } my $rpt_cleaners = 0; +my $symbol_link = 0; if ($terse) { $emacs = 1; @@ -3595,6 +3596,10 @@ sub process { "Do not include the paragraph about writing to the Free Software Foundation's mailing address from the sample GPL notice. The FSF has changed addresses in the past, and may do so again. Linux already includes a copy of the GPL.\n" . $herevet) } + if ($line =~ /^new file mode 120000$/) { + $symbol_link = 1; + } + # check for Kconfig help text having a real description # Only applies when adding the entry originally, after that we do not have # sufficient context to determine whether it is indeed long enough. @@ -3756,7 +3761,8 @@ sub process { } if ($comment !~ /^$/ && - $rawline !~ m@^\+\Q$comment\E SPDX-License-Identifier: @) { + $rawline !~ m@^\+\Q$comment\E SPDX-License-Identifier: @ && + $symbol_link =~ 1) { WARN("SPDX_LICENSE_TAG", "Missing or malformed SPDX-License-Identifier tag in line $checklicenseline\n" . $herecurr); } elsif ($rawline =~ /(SPDX-License-Identifier: .*)/) { @@ -3867,7 +3873,8 @@ sub process { } # check for adding lines without a newline. - if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) { + if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/ && + $symbol_link =~ 1) { if (WARN("MISSING_EOF_NEWLINE", "adding a line without newline at end of file\n" . $herecurr) && $fix) {