Skip to content

Commit 89e7fec

Browse files
committed
kbuild: move W=1 check for scripts/misc-check to top-level Makefile
This script is executed only when ${KBUILD_EXTRA_WARN} contains 1. Move this check to the top-level Makefile to allow more checks to be easily added to this script. Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]>
1 parent a503a31 commit 89e7fec

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1827,9 +1827,12 @@ rustfmtcheck: rustfmt
18271827
# Misc
18281828
# ---------------------------------------------------------------------------
18291829

1830+
# Run misc checks when ${KBUILD_EXTRA_WARN} contains 1
18301831
PHONY += misc-check
1832+
ifneq ($(findstring 1,$(KBUILD_EXTRA_WARN)),)
18311833
misc-check:
18321834
$(Q)$(srctree)/scripts/misc-check
1835+
endif
18331836

18341837
all: misc-check
18351838

scripts/misc-check

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,8 @@
33

44
set -e
55

6-
# Detect files that are tracked but ignored by git. This is checked only when
7-
# ${KBUILD_EXTRA_WARN} contains 1, git is installed, and the source tree is
8-
# tracked by git.
6+
# Detect files that are tracked but ignored by git.
97
check_tracked_ignored_files () {
10-
case "${KBUILD_EXTRA_WARN}" in
11-
*1*) ;;
12-
*) return;;
13-
esac
14-
158
git -C ${srctree:-.} ls-files -i -c --exclude-per-directory=.gitignore 2>/dev/null |
169
sed 's/$/: warning: ignored by one of the .gitignore files/' >&2
1710
}

0 commit comments

Comments
 (0)