Skip to content

Commit

Permalink
checkpatch: allow build files to reference other build files
Browse files Browse the repository at this point in the history
Add an exception to the EMBEDDED_FILENAME warning for build files. This
fixes the below warnings where the Kconfig and Makefile files reference
other similarly named build files.

  WARNING:EMBEDDED_FILENAME: It's generally not useful to have the
  filename in the file
  torvalds#24: FILE: Kconfig:34:
  +source "drivers/willmcvicker/Kconfig"

  WARNING:EMBEDDED_FILENAME: It's generally not useful to have the
  filename in the file
  torvalds#36: FILE: Makefile:667:
  +	} > Makefile

Signed-off-by: Will McVicker <[email protected]>
  • Loading branch information
Will McVicker authored and intel-lab-lkp committed Jan 12, 2024
1 parent 70d201a commit 2ea5609
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3785,7 +3785,9 @@ sub process {
}

# check for embedded filenames
if ($rawline =~ /^\+.*\b\Q$realfile\E\b/) {
if ($rawline =~ /^\+.*\b\Q$realfile\E\b/ &&
$realfile !~ /Kconfig.*/ &&
$realfile !~ /Makefile.*/) {
WARN("EMBEDDED_FILENAME",
"It's generally not useful to have the filename in the file\n" . $herecurr);
}
Expand Down

0 comments on commit 2ea5609

Please sign in to comment.