Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 147a89bc authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull Kconfig updates from Masahiro Yamada:

 - improve checkpatch for more precise Kconfig code checking

 - clarify effective selects by grouping reverse dependencies in help

 - do not write out '# CONFIG_FOO is not set' from invisible symbols

 - make oldconfig as silent as it should be

 - rename 'silentoldconfig' to 'syncconfig'

 - add unit-test framework and several test cases

 - warn unmet dependency of tristate symbols

 - make unmet dependency warnings readable, removing false positives

 - improve recursive include detection

 - use yylineno to simplify the line number tracking

 - misc cleanups

* tag 'kconfig-v4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (30 commits)
  kconfig: use yylineno option instead of manual lineno increments
  kconfig: detect recursive inclusion earlier
  kconfig: remove duplicated file name and lineno of recursive inclusion
  kconfig: do not include both curses.h and ncurses.h for nconfig
  kconfig: make unmet dependency warnings readable
  kconfig: warn unmet direct dependency of tristate symbols selected by y
  kconfig: tests: test if recursive inclusion is detected
  kconfig: tests: test if recursive dependencies are detected
  kconfig: tests: test randconfig for choice in choice
  kconfig: tests: test defconfig when two choices interact
  kconfig: tests: check visibility of tristate choice values in y choice
  kconfig: tests: check unneeded "is not set" with unmet dependency
  kconfig: tests: test if new symbols in choice are asked
  kconfig: tests: test automatic submenu creation
  kconfig: tests: add basic choice tests
  kconfig: tests: add framework for Kconfig unit testing
  kbuild: add PYTHON2 and PYTHON3 variables
  kconfig: remove redundant streamline_config.pl prerequisite
  kconfig: rename silentoldconfig to syncconfig
  kconfig: invoke oldconfig instead of silentoldconfig from local*config
  ...
parents 3b24b837 18492685
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ Examples:
		15% of tristates will be set to 'y', 15% to 'm', 70% to 'n'

______________________________________________________________________
Environment variables for 'silentoldconfig'
Environment variables for 'syncconfig'

KCONFIG_NOSILENTUPDATE
--------------------------------------------------
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ Enabling the driver
The driver is enabled via the standard kernel configuration system,
using the make command:

     Make oldconfig/silentoldconfig/menuconfig/etc.
     make config/oldconfig/menuconfig/etc.

The driver is located in the menu structure at:

+4 −2
Original line number Diff line number Diff line
@@ -386,6 +386,8 @@ INSTALLKERNEL := installkernel
DEPMOD		= /sbin/depmod
PERL		= perl
PYTHON		= python
PYTHON2		= python2
PYTHON3		= python3
CHECK		= sparse

CHECKFLAGS     := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
@@ -432,7 +434,7 @@ GCC_PLUGINS_CFLAGS :=

export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC
export CPP AR NM STRIP OBJCOPY OBJDUMP HOSTLDFLAGS HOST_LOADLIBES
export MAKE LEX YACC AWK GENKSYMS INSTALLKERNEL PERL PYTHON UTS_MACHINE
export MAKE LEX YACC AWK GENKSYMS INSTALLKERNEL PERL PYTHON PYTHON2 PYTHON3 UTS_MACHINE
export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS

export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
@@ -591,7 +593,7 @@ $(KCONFIG_CONFIG) include/config/auto.conf.cmd: ;
# include/generated/ and include/config/. Update them if .config is newer than
# include/config/auto.conf (which mirrors .config).
include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
	$(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
	$(Q)$(MAKE) -f $(srctree)/Makefile syncconfig
else
# external modules needs include/generated/autoconf.h and include/config/auto.conf
# but do not care if they are up-to-date. Use auto.conf to trigger the test
+17 −4
Original line number Diff line number Diff line
@@ -2797,7 +2797,10 @@ sub process {
# Only applies when adding the entry originally, after that we do not have
# sufficient context to determine whether it is indeed long enough.
		if ($realfile =~ /Kconfig/ &&
		    $line =~ /^\+\s*config\s+/) {
		    # 'choice' is usually the last thing on the line (though
		    # Kconfig supports named choices), so use a word boundary
		    # (\b) rather than a whitespace character (\s)
		    $line =~ /^\+\s*(?:config|menuconfig|choice)\b/) {
			my $length = 0;
			my $cnt = $realcnt;
			my $ln = $linenr + 1;
@@ -2812,9 +2815,13 @@ sub process {
				next if ($f =~ /^-/);
				last if (!$file && $f =~ /^\@\@/);

				if ($lines[$ln - 1] =~ /^\+\s*(?:bool|tristate)\s*\"/) {
				if ($lines[$ln - 1] =~ /^\+\s*(?:bool|tristate|prompt)\s*["']/) {
					$is_start = 1;
				} elsif ($lines[$ln - 1] =~ /^\+\s*(?:---)?help(?:---)?$/) {
				} elsif ($lines[$ln - 1] =~ /^\+\s*(?:help|---help---)\s*$/) {
					if ($lines[$ln - 1] =~ "---help---") {
						WARN("CONFIG_DESCRIPTION",
						     "prefer 'help' over '---help---' for new help texts\n" . $herecurr);
					}
					$length = -1;
				}

@@ -2822,7 +2829,13 @@ sub process {
				$f =~ s/#.*//;
				$f =~ s/^\s+//;
				next if ($f =~ /^$/);
				if ($f =~ /^\s*config\s/) {

				# This only checks context lines in the patch
				# and so hopefully shouldn't trigger false
				# positives, even though some of these are
				# common words in help texts
				if ($f =~ /^\s*(?:config|menuconfig|choice|endchoice|
						  if|endif|menu|endmenu|source)\b/x) {
					$is_end = 1;
					last;
				}
+22 −7
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
# Kernel configuration targets
# These targets are used from top-level makefile

PHONY += xconfig gconfig menuconfig config silentoldconfig update-po-config \
PHONY += xconfig gconfig menuconfig config syncconfig update-po-config \
	localmodconfig localyesconfig

ifdef KBUILD_KCONFIG
@@ -36,22 +36,22 @@ nconfig: $(obj)/nconf

# This has become an internal implementation detail and is now deprecated
# for external use.
silentoldconfig: $(obj)/conf
syncconfig: $(obj)/conf
	$(Q)mkdir -p include/config include/generated
	$< $(silent) --$@ $(Kconfig)

localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
localyesconfig localmodconfig: $(obj)/conf
	$(Q)mkdir -p include/config include/generated
	$(Q)perl $< --$@ $(srctree) $(Kconfig) > .tmp.config
	$(Q)perl $(srctree)/$(src)/streamline_config.pl --$@ $(srctree) $(Kconfig) > .tmp.config
	$(Q)if [ -f .config ]; then 					\
			cmp -s .tmp.config .config ||			\
			(mv -f .config .config.old.1;			\
			 mv -f .tmp.config .config;			\
			 $(obj)/conf $(silent) --silentoldconfig $(Kconfig); \
			 $< $(silent) --oldconfig $(Kconfig);		\
			 mv -f .config.old.1 .config.old)		\
	else								\
			mv -f .tmp.config .config;			\
			$(obj)/conf $(silent) --silentoldconfig $(Kconfig); \
			$< $(silent) --oldconfig $(Kconfig);		\
	fi
	$(Q)rm -f .tmp.config

@@ -86,7 +86,7 @@ PHONY += $(simple-targets)
$(simple-targets): $(obj)/conf
	$< $(silent) --$@ $(Kconfig)

PHONY += oldnoconfig savedefconfig defconfig
PHONY += oldnoconfig silentoldconfig savedefconfig defconfig

# oldnoconfig is an alias of olddefconfig, because people already are dependent
# on its behavior (sets new symbols to their default value but not 'n') with the
@@ -95,6 +95,13 @@ oldnoconfig: olddefconfig
	@echo "  WARNING: \"oldnoconfig\" target will be removed after Linux 4.19"
	@echo "            Please use \"olddefconfig\" instead, which is an alias."

# We do not expect manual invokcation of "silentoldcofig" (or "syncconfig").
silentoldconfig: syncconfig
	@echo "  WARNING: \"silentoldconfig\" has been renamed to \"syncconfig\""
	@echo "            and is now an internal implementation detail."
	@echo "            What you want is probably \"oldconfig\"."
	@echo "            \"silentoldconfig\" will be removed after Linux 4.19"

savedefconfig: $(obj)/conf
	$< $(silent) --$@=defconfig $(Kconfig)

@@ -133,6 +140,14 @@ PHONY += tinyconfig
tinyconfig:
	$(Q)$(MAKE) -f $(srctree)/Makefile allnoconfig tiny.config

# CHECK: -o cache_dir=<path> working?
PHONY += testconfig
testconfig: $(obj)/conf
	$(PYTHON3) -B -m pytest $(srctree)/$(src)/tests \
	-o cache_dir=$(abspath $(obj)/tests/.cache) \
	$(if $(findstring 1,$(KBUILD_VERBOSE)),--capture=no)
clean-dirs += tests/.cache

# Help text used by make help
help:
	@echo  '  config	  - Update current config utilising a line-oriented program'
Loading