History

Merge tag 'kconfig-v4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

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 ...

Linus Torvalds committed 8 years ago

Commit 147a89b2 parents 3b24b83 184926858 files · +1043 −139Browse files

Showing the changes to scripts/checkpatch.pl (1 of 58 files). Show all

Unified · Split

scripts/checkpatch.pl+17−4
@@ -2797,7 +2797,10 @@ sub process { · 2796 unmodified lines
27972797 # Only applies when adding the entry originally, after that we do not have
27982798 # sufficient context to determine whether it is indeed long enough.
27992799 if ($realfile =~ /Kconfig/ &&
2800− $line =~ /^\+\s*config\s+/) {
2800+ # 'choice' is usually the last thing on the line (though
2801+ # Kconfig supports named choices), so use a word boundary
2802+ # (\b) rather than a whitespace character (\s)
2803+ $line =~ /^\+\s*(?:config|menuconfig|choice)\b/) {
28012804 my $length = 0;
28022805 my $cnt = $realcnt;
28032806 my $ln = $linenr + 1;
@@ -2812,9 +2815,13 @@ sub process { · 8 unmodified lines
28122815 next if ($f =~ /^-/);
28132816 last if (!$file && $f =~ /^\@\@/);
28142817
2815− if ($lines[$ln - 1] =~ /^\+\s*(?:bool|tristate)\s*\"/) {
2818+ if ($lines[$ln - 1] =~ /^\+\s*(?:bool|tristate|prompt)\s*["']/) {
28162819 $is_start = 1;
2817− } elsif ($lines[$ln - 1] =~ /^\+\s*(?:---)?help(?:---)?$/) {
2820+ } elsif ($lines[$ln - 1] =~ /^\+\s*(?:help|---help---)\s*$/) {
2821+ if ($lines[$ln - 1] =~ "---help---") {
2822+ WARN("CONFIG_DESCRIPTION",
2823+ "prefer 'help' over '---help---' for new help texts\n" . $herecurr);
2824+ }
28182825 $length = -1;
28192826 }
28202827
@@ -2822,7 +2829,13 @@ sub process { · 1 unmodified line
28222829 $f =~ s/#.*//;
28232830 $f =~ s/^\s+//;
28242831 next if ($f =~ /^$/);
2825− if ($f =~ /^\s*config\s/) {
2832+
2833+ # This only checks context lines in the patch
2834+ # and so hopefully shouldn't trigger false
2835+ # positives, even though some of these are
2836+ # common words in help texts
2837+ if ($f =~ /^\s*(?:config|menuconfig|choice|endchoice|
2838+ if|endif|menu|endmenu|source)\b/x) {
28262839 $is_end = 1;
28272840 last;
28282841 }