summaryrefslogtreecommitdiffstats
path: root/scripts/kconfig
AgeCommit message (Collapse)AuthorFilesLines
2015-01-27kconfig: use va_end to match corresponding va_startColin Ian King1-0/+1
Although on some systems va_end is a no-op, it is good practice to use va_end, especially since the manual states: "Each invocation of va_start() must be matched by a corresponding invocation of va_end() in the same function." Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2015-01-07merge_config.sh: Display usage if given too few argumentsOlof Johansson1-0/+5
Two or more arguments are always expected. Show usage and exit if given less. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Michal Marek <mmarek@suse.cz>
2014-12-20Merge branch 'kbuild' of ↵Linus Torvalds1-2/+2
git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild Pull kbuild updates from Michal Marek: "Here are the kbuild changes for v3.19-rc1: - Cleanups and deduplication in the main Makefile and scripts/Makefile.* - Sort the output of *config targets in make help - Old <linux/version.h> is always removed to avoid a surprise during bisecting - Warning fix in kconfig" * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: kbuild: remove redundant -rR flag of hdr-inst kbuild: Fix make help-<board series> on powerpc kbuild: Automatically remove stale <linux/version.h> file kconfig: Fix warning "‘jump’ may be used uninitialized" Makefile: sort list of defconfig targets in make help output kbuild: Remove duplicate $(cmd) definition in Makefile.clean kbuild: collect shorthands into scripts/Kbuild.include
2014-12-19Merge branch 'perf-urgent-for-linus' of ↵Linus Torvalds1-2/+2
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf fixes and cleanups from Ingo Molnar: "A kernel fix plus mostly tooling fixes, but also some tooling restructuring and cleanups" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (39 commits) perf: Fix building warning on ARM 32 perf symbols: Fix use after free in filename__read_build_id perf evlist: Use roundup_pow_of_two tools: Adopt roundup_pow_of_two perf tools: Make the mmap length autotuning more robust tools: Adopt rounddown_pow_of_two and deps tools: Adopt fls_long and deps tools: Move bitops.h from tools/perf/util to tools/ tools: Introduce asm-generic/bitops.h tools lib: Move asm-generic/bitops/find.h code to tools/include and tools/lib tools: Whitespace prep patches for moving bitops.h tools: Move code originally from asm-generic/atomic.h into tools/include/asm-generic/ tools: Move code originally from linux/log2.h to tools/include/linux/ tools: Move __ffs implementation to tools/include/asm-generic/bitops/__ffs.h perf evlist: Do not use hard coded value for a mmap_pages default perf trace: Let the perf_evlist__mmap autosize the number of pages to use perf evlist: Improve the strerror_mmap method perf evlist: Clarify sterror_mmap variable names perf evlist: Fixup brown paper bag on "hint" for --mmap-pages cmdline arg perf trace: Provide a better explanation when mmap fails ...
2014-12-09calloc/xcalloc: Fix argument orderArjun Sreedharan1-2/+2
The calloc() and xcalloc() functions takes @nmemb first and then @size. Fix all w/ pattern "calloc\s*(\s*sizeof". Signed-off-by: Arjun Sreedharan <arjun024@gmail.com> Cc: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Ingo Molnar <mingo@redhat.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1417866043-1877-1-git-send-email-arjun024@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2014-11-28kconfig: Fix warning "‘jump’ may be used uninitialized"Peter Kümmel1-2/+2
Warning: In file included from scripts/kconfig/zconf.tab.c:2537:0: scripts/kconfig/menu.c: In function ‘get_symbol_str’: scripts/kconfig/menu.c:590:18: warning: ‘jump’ may be used uninitialized in this function [-Wmaybe-uninitialized] jump->offset = strlen(r->s); Simplifies the test logic because (head && local) means (jump != 0) and makes GCC happy when checking if the jump pointer was initialized. Signed-off-by: Peter Kümmel <syntheticpp@gmx.net> Signed-off-by: Michal Marek <mmarek@suse.cz>
2014-11-20Replace mentions of "list_struct" to "list_head"Andrey Utkin1-3/+3
There's no such thing as "list_struct". Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com> Acked-by: Steven Rostedt <rostedt@goodmis.org> Acked-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-10-14Merge branch 'kbuild' of ↵Linus Torvalds4-35/+11
git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild Pull kbuild changes from Michal Marek: - fix for handling dependencies of *-objs targets by Masahiro Yamada - lots of cleanups in the kbuild machinery, also by Masahiro - fixes for the kconfig build to use an UTF-8 capable ncurses library if possible and to build on not-so-standard installs - some more minor fixes * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: kbuild: Do not reference *-n variables in the Makefile kbuild: simplify build, clean, modbuiltin shorthands kbuild: arm: Do not define "comma" twice kbuild: remove obj-n and lib-n handling kbuild: remove unnecessary variable initializaions kbuild: remove unnecessary "obj- := dummy.o" trick kbuild: handle C=... and M=... after entering into build directory kbuild: use $(Q) for sub-make target kbuild: fake the "Entering directory ..." message more simply kconfig/lxdialog: get ncurses CFLAGS with pkg-config kconfig: nconfig: fix multi-byte UTF handling kconfig: lxdialog: fix spelling kbuild: Make scripts executable kbuild: remove redundant clean-files from scripts/kconfig/Makefile kbuild: refactor script/kconfig/Makefile kbuild: handle the dependency of multi-objs hostprogs appropriately kbuild: handle multi-objs dependency appropriately
2014-09-23kconfig/lxdialog: get ncurses CFLAGS with pkg-configBjørn Forsman1-1/+5
This makes "make menuconfig" also work on systems where ncurses is not installed in a standard location (such as on NixOS). This patch changes ccflags() so that it tries pkg-config first, and only if pkg-config fails does it go back to the fallback/manual checks. This is the same algorithm that ldflags() already uses. Signed-off-by: Bjørn Forsman <bjorn.forsman@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2014-08-22kconfig: nconfig: fix multi-byte UTF handlingBrian Norris1-1/+2
Currently, Kconfig descriptions that use multi-byte UTF-8 characters (such as MTD_NAND_CAFE) will have their menu entries dropped from the 'make nconfig' ncurses menu, and all subsequent entries in the same window will be omitted. This seems to be due to the ncurses 'menu' library, which does not traditionally handle UTF-8 >8-bit characters properly. The ncursesw library ('w' is for "wide") is written to handle these UTF-8 characters, and is practically a drop-in replacement at the source level. Use it by default, if available. Link: https://bugzilla.kernel.org/show_bug.cgi?id=43067 Signed-off-by: Brian Norris <computersforpeace@gmail.com> Cc: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Martin Walch <walch.martin@web.de> Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
2014-08-22kconfig: lxdialog: fix spellingBrian Norris1-1/+1
Signed-off-by: Brian Norris <computersforpeace@gmail.com> Cc: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Michal Marek <mmarek@suse.cz>
2014-08-20kbuild: Make scripts executableMichal Marek2-0/+0
The Makefiles call the respective interpreter explicitly, but this makes it easier to use the scripts manually. Signed-off-by: Michal Marek <mmarek@suse.cz>
2014-08-19kbuild: remove redundant clean-files from scripts/kconfig/MakefileMasahiro Yamada1-1/+0
Now mconf, qconf, gconf, nconf are always added to hostprogs-y. Files added to hostprogs-y are removed by "make clean". Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2014-08-19kbuild: refactor script/kconfig/MakefileMasahiro Yamada1-31/+3
Now it is harmless to add all host programs to hostprogs-y. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2014-08-08x86: Add "make tinyconfig" to configure the tiniest possible kernelJosh Triplett1-0/+5
Since commit 5d2acfc7b974bbd3858b4dd3f2cdc6362dd8843a ("kconfig: make allnoconfig disable options behind EMBEDDED and EXPERT") in 3.15-rc1, "make allnoconfig" disables every possible config option. However, a few configuration options (CC_OPTIMIZE_FOR_SIZE, OPTIMIZE_INLINING) produce a smaller kernel when turned on, and a few choices exist (compression, highmem, allocator) for which a non-default option produces a smaller kernel. Add a "tinyconfig" option, which starts from allnoconfig and then sets these options to configure the tiniest possible kernel. This provides a better baseline for embedded systems or efforts to reduce kernel size. Signed-off-by: Josh Triplett <josh@joshtriplett.org>
2014-08-08x86, platform, kconfig: move kvmconfig functionality to a helperJosh Triplett1-0/+14
The new mergeconfig helper makes it easier to add other partial configurations similar to kvmconfig. Architecture-independent portions of those partial configurations should go in kernel/configs/${name}.config, and architecture-dependent portions should go in arch/${arch}/configs/${name}.config. Based on a patch by Luis R. Rodriguez <mcgrof@suse.com>. Originally-Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com> Modified to make the helper name more general than just virtualization, support architecture-dependent and architecture-independent partial configurations, move the helper and kvmconfig to scripts/kconfig/Makefile, and factor out more of the common file path. Signed-off-by: Josh Triplett <josh@joshtriplett.org>
2014-06-12Merge branch 'misc' of ↵Linus Torvalds16-24/+18
git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild Pull kbuild misc updates from Michal Marek: "This is the non-critical part of kbuild for v3.16-rc1: - make deb-pkg can do s390x and arm64 - new patterns in scripts/tags.sh - scripts/tags.sh skips userspace tools' sources (which sometimes have copies of kernel structures) and symlinks - improvements to the objdiff tool - two new coccinelle patches - other minor fixes" * 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: scripts: objdiff: support directories for the augument of record command scripts: objdiff: fix a comment scripts: objdiff: change the extension of disassembly from .o to .dis scripts: objdiff: improve path flexibility for record command scripts: objdiff: remove unnecessary code scripts: objdiff: direct error messages to stderr scripts: objdiff: get the path to .tmp_objdiff more simply deb-pkg: Add automatic support for s390x architecture coccicheck: Add unneeded return variable test kbuild: Fix a typo in documentation kbuild: trivial - use tabs for code indent where possible kbuild: trivial - remove trailing empty lines coccinelle: Check for missing NULL terminators in of_device_id tables scripts/tags.sh: ignore symlink'ed source files scripts/tags.sh: add regular expression replacement pattern for memcg builddeb: add arm64 in the supported architectures builddeb: use $OBJCOPY variable instead of objcopy scripts/tags.sh: ignore code of user space tools scripts/tags.sh: add pattern for DEFINE_HASHTABLE .gitignore: ignore Module.symvers in all directories
2014-06-10kbuild: trivial - use tabs for code indent where possibleMasahiro Yamada12-18/+18
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2014-06-10kbuild: create include/config directory in scripts/kconfig/MakefileMasahiro Yamada1-2/+2
The directory include/config is used only for silentoldconfig, localmodconfig, localyesconfig. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2014-06-10kbuild: trivial - remove trailing empty linesMasahiro Yamada5-6/+0
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-04-30kbuild: trivial - remove trailing spacesMasahiro Yamada1-1/+1
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2014-04-07kconfig: make allnoconfig disable options behind EMBEDDED and EXPERTJosh Triplett6-6/+20
"make allnoconfig" exists to ease testing of minimal configurations. Documentation/SubmitChecklist includes a note to test with allnoconfig. This helps catch missing dependencies on common-but-not-required functionality, which might otherwise go unnoticed. However, allnoconfig still leaves many symbols enabled, because they're hidden behind CONFIG_EMBEDDED or CONFIG_EXPERT. For instance, allnoconfig still has CONFIG_PRINTK and CONFIG_BLOCK enabled, so drivers don't typically get build-tested with those disabled. To address this, introduce a new Kconfig option "allnoconfig_y", used on symbols which only exist to hide other symbols. Set it on CONFIG_EMBEDDED (which then selects CONFIG_EXPERT). allnoconfig will then disable all the symbols hidden behind those. Signed-off-by: Josh Triplett <josh@joshtriplett.org> Tested-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Michal Marek <mmarek@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-12-20localmodconfig: Add config depends by default settingsSteven Rostedt (Red Hat)1-0/+7
Currently localmodconfig will miss dependencies from the default option. For example: config FOO default y if BAR || ZOO If FOO is needed for a module and is set to '=m', and so are BAR or ZOO, localmodconfig will not see that BOO or ZOO are also needed for the foo module, and will incorrectly disable them. Link: http://lkml.kernel.org/r/20131218175137.162937350@goodmis.org Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2013-10-08xconfig: Fix the filename for GUI settingsBen Hutchings2-0/+6
Currently the qconf program invoked by 'make xconfig' stores GUI settings in the file ~/.config/Unknown\ Organization.conf. This name is apparently generated by the QSettings class when no organisation or application name are specified. This is obviously not a sensible filename (nor does it seem sensible that these QSettings parameters are optional!). Pass the names 'kernel.org' and 'qconf', resuling in the filename ~/.config/kernel.org/qconf.conf. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-10-08kconfig: fix bug in search results string: use strlen(gstr->s), not gstr->lenMartin Walch1-1/+1
The struct gstr has a capacity that may differ from the actual string length. However, a string manipulation in the function search_conf made the assumption that it is the same, which led to messing up some search results, especially when the content of the gstr in use had not yet reached at least 63 chars. Signed-off-by: Martin Walch <walch.martin@web.de> Acked-by: Wang YanQing <udknight@gmail.com> Acked-by: Benjamin Poirier <bpoirier@suse.de> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-10-08kconfig: remove unused definition from scannerMartin Walch1-1/+0
The definition ws [ \n\t] is not used anywhere. Drop it to avoid confusion. As it is a dead definition, any changes in the resulting code generated by flex would be surprising (actually testing this showed that there are really no changes). So, there is no need to touch the existing zconf.lex.c_shipped. Signed-off-by: Martin Walch <walch.martin@web.de> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: "Yann E. MORIN: <yann.morin.1998@free.fr>
2013-10-08kconfig: adjust warning message for conflicting typesMartin Walch1-3/+4
Each symbol must have exactly one type assigned. However, if a symbol happens to have two different types assigned at runtime, a warning is printed and the first type is preserved while the second type is being ignored. The warning message says type of <symbol name> redefined from <first type> to <second type> which may be misleading as it may create the impression that the second type replaces the first type. This patch clarifies this by changing the warning to ignoring type redefinition of <symbol name> from <first type> to <second type> Signed-off-by: Martin Walch <walch.martin@web.de> Acked-by: Wang YanQing <udknight@gmail.com> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-10-08kconfig: fix trivial typos and update mconf documentationMartin Walch3-33/+31
This fixes lots of typos in comments and strings. It also updates the documentation strings in mconf to reflect the changes in the user interface from the two commits 6364fd0cb1e4c7f72b974613e0cf5744ae4d2cb2 menuconfig: Add Save/Load buttons 1bdbac478a858d2aa73a6784c7c2e09de0f6d06b menuconfig: Get rid of the top-level entries for "Load an Alternate/Save an Alternate" And it updates the layout of the example search result, i. e. moves down the "Defined at" and "Depends on" lines and adds a symbol state ([=n]) to the symbol in the "Selected by" line. Furthermore, the help texts now should fit in 80 columns again when viewed in mconf. Signed-off-by: Martin Walch <walch.martin@web.de> Reviewed-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Wang YanQing <udknight@gmail.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-10-08kconfig: add short explanation to SYMBOL_WRITEMartin Walch1-1/+1
replace the question mark in the comment after SYMBOL_WRITE with an explanation Signed-off-by: Martin Walch <walch.martin@web.de> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-09-05kconfig: do not allow more than one symbol to have 'option modules'Yann E. MORIN1-0/+6
Previously, it was possible to have more than one symbol with the 'option modules' attached to them, although only the last one would in fact control tristates. Since this does not make much sense, only allow at most one symbol to control tristates. Note: it is still possible to have more than one symbol that control tristates, but indirectly: config MOD1 bool "mod1" select MODULES config MOD2 bool "mod2" select MODULES config MODULES bool option modules Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
2013-09-05kconfig: regenerate bison parserYann E. MORIN1-264/+298
Regenerate bison parser after changes made in: 6902dcc: kconfig: do not special-case 'MODULES' symbol Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
2013-09-05kconfig: do not special-case 'MODULES' symbolYann E. MORIN2-13/+3
Currently, the 'MODULES' symbol is hard-coded to be the default symbol that enables/disables tristates, if no other symbol was declared with 'option modules'. While this used to be needed for the Linux kernel, we now have an explicit 'option modules' attached to the 'MODULES' symbol (since cset 11097a036), so we no longer need to special-case it in the kconfig code. Furthermore, kconfig is extensively used out of the Linux kernel, and other projects may have another meaning for a symbol named 'MODULES'. This patch changes the way we enable/disable tristates: if a symbol was found with 'option modules' attached to it, then that symbol controls enabling tristates. Otherwise, tristates are disabled, even if a symbol named 'MODULES' exists. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
2013-08-15kconfig: silence warning when parsing auto.conf when a symbol has changed typeYann E. MORIN1-3/+8
When a symbol changes type from tristate to bool, and was previously set to 'm', a subsequent silentoldconfig would warn about inconsistency, such as: include/config/auto.conf:3014:warning: symbol value 'm' invalid for HOTPLUG_PCI_PCIE Seen by Linus with the merge in aa8032b (sequence to reproduce by Michal): git checkout 1fe0135 make mrproper make allmodconfig make silentoldconfig git checkout aa8032b make allmodconfig make silentoldconfig Since HOTPLUG_PCI_PCIE changed from tristate to bool in aa8032b, it was previously set to 'm' in auto.conf by the first allmodconfig+silentoldconfig, but then was set to 'y' by the second allmodconfig. Then the second silentoldconfig prints the warning. The warning in this case is a spurious warning, which happens at the time kconfig tries to detect symbols that have changed, to touch the empty header files in include/config used for dependency-tracking by make. Silence the warning when we read the old auto.conf file, since it is perfectly legit that a symbol changed type since the previous call. Thread in: http://marc.info/?l=linux-pci&m=137569198904000&w=2 Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Michal Marek <mmarek@suse.cz> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Bjorn Helgaas <bhelgaas@google.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-08-15kconfig: switch to "long long" for sanityKees Cook1-9/+10
Instead of using "long" for kconfig "hex" and "range" values, which may change in size depending on the host architecture, use "long long". This will allow values greater than INT_MAX on 32-bit hosts when cross compiling. Signed-off-by: Kees Cook <keescook@chromium.org> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-07-23Merge branch 'yem-kconfig-rc-fixes' of ↵Michal Marek3-33/+24
git://gitorious.org/linux-kconfig/linux-kconfig into kbuild/kconfig
2013-07-16kconfig: simplify symbol-search codeYann E. MORIN1-19/+11
There is no need for a double indirection in the temporary array that stores the internediate search results. Reported-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: Jean Delvare <jdelvare@suse.de>
2013-07-16kconfig: don't allocate n+1 elements in temporary arrayYann E. MORIN1-1/+1
The temporary array that stores the search results is not NULL-terminated, so there is no reason to allocate n+1 elements. Reported-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: Jean Delvare <jdelvare@suse.de>
2013-07-16kconfig: minor style fixes in symbol-search codeYann E. MORIN1-4/+3
Two minor style fixes: - no space before/after parenthesis in function definition - no {} for single-line if() And one grammar fix in a comment. Reported-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Jean Delvare <jdelvare@suse.de> Reviewed-by: Jean Delvare <jdelvare@suse.de>
2013-07-16kconfig/[mn]conf: shorten title in search-boxYann E. MORIN2-4/+4
No need to repeat the 'CONFIG_' string in the title, once is explicit enough. Reported-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Jean Delvare <jdelvare@suse.de>
2013-07-16kconfig: avoid multiple calls to strlenYann E. MORIN1-5/+5
Calls to strlen are costly, so avoid calling strln as much as we can. Reported-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Jean Delvare <jdelvare@suse.de> Reviewed-by: Jean Delvare <jdelvare@suse.de>
2013-07-10Merge branch 'kconfig' of ↵Linus Torvalds17-95/+242
git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild Pull kconfig updates from Michal Marek: - dependency solver fix for make defconfig - randconfig fixes, one of which had to be reverted again - more user-friendly sorting of search results - hex and range keywords support longs - fix for [mn]conf not to rely on particular behavior of the LINES and COLS variables - cleanup of magic constants in kconfig/lxdialog - [mn]conf formatting fixes - fix for scripts/config's help text in out-of-tree usage (under a different name) * 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: kconfig: allow "hex" and "range" to support longs Revert "kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG" kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG kconfig: loop as long as we changed some symbols in randconfig kconfig/[mn]conf: make it explicit in the search box that a regexp is possible kconfig: sort found symbols by relevance kconfig/conf: print the seed used to initialise the RNG for randconfig kconfig/conf: accept a base-16 seed for randconfig kconfig/conf: fix randconfig setting multiple symbols in a choice scripts/config: replace hard-coded script name by a dynamic value mconf/nconf: mark empty menus/menuconfigs different from non-empty ones nconf: use function calls instead of ncurses' variables LINES and COLS mconf: use function calls instead of ncurses' variables LINES and COLS kconfig/lxdialog: handle newline characters in print_autowrap() kconfig/lxdialog: Use new mininimum resize definitions in conf_choice() kconfig/lxdialog: Add definitions for mininimum (re)size values kconfig: Fix defconfig when one choice menu selects options that another choice menu depends on
2013-06-29kconfig: allow "hex" and "range" to support longsKees Cook1-5/+5
The parsing routines for Kconfig files use strtol(), but store and render values as int. Switch types and formating to long to support a wider range of values. For example, 0x80000000 wasn't representable. Signed-off-by: Kees Cook <keescook@chromium.org> Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-06-26Revert "kconfig: fix randomising choice entries in presence of ↵Yann E. MORIN1-3/+3
KCONFIG_ALLCONFIG" This reverts commit 8357b48549e17b3e4e402c7f977b65708922e60f. It breaks more stuff than it fixes. Reported-by: Fengguang Wu <fengguang.wu@intel.com> Reported-by: Sedat Dilek <sedat.dilek@gmail.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Fengguang Wu <fengguang.wu@intel.com> Cc: Sedat Dilek <sedat.dilek@gmail.com> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Alexandre Bounine <alexandre.bounine@idt.com> Cc: Matt Porter <mporter@kernel.crashing.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
2013-06-24kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIGYann E. MORIN1-3/+3
Currently, randconfig does randomise choice entries, unless KCONFIG_ALLCONFIG is specified. For example, given those two files (Thomas' test-case): ---8<--- Config.test.in config OPTIONA bool "Option A" choice prompt "This is a choice" config CHOICE_OPTIONA bool "Choice Option A" config CHOICE_OPTIONB bool "Choice Option B" endchoice config OPTIONB bool "Option B" ---8<--- Config.test.in ---8<--- config.defaults CONFIG_OPTIONA=y ---8<--- config.defaults And running: ./scripts/kconfig/conf --randconfig Config.test.in does properly randomise the two choice symbols (and the two booleans). However, running: KCONFIG_ALLCONFIG=config.defaults \ ./scripts/kconfig/conf --randconfig Config.test.in does *not* reandomise the two choice entries, and only CHOICE_OPTIONA will ever be selected. (OPTIONA will always be set (expected), and OPTIONB will be be properly randomised (expected).) This patch defers setting that a choice has a value until a symbol for that choice is indeed set, so that choices are properly randomised when KCONFIG_ALLCONFIG is set, but not if a symbol for that choice is set. Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Michal Marek <mmarek@suse.cz> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Sedat Dilek <sedat.dilek@gmail.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Stephen Rothwell <sfr@canb.auug.org.au> --- Changes v3 -> v4 - fix previous issue where some choices would not be set, which would cause silentoldconfig to ask for them and was then breaking this workflow (as reported by Arnd and Sedat): KCONFIG_ALLCONFIG=foo.defconfig make randconfig make silentoldconfig </dev/nullo which I have tested (3h28min!) with: touch defconfig for(( i=0; i<10000; i++ )); do KCONFIG_ALLCONFIG=$(pwd)/defconfig make randconfig >/dev/null 2>&1 make silentoldconfig </dev/null >/dev/null 2>&1 || break done which did not break at all. - change done in v3 (below) is already fixed by a previous patch Changes v2 -> v3 - ensure only one symbol is set in a choice Changes v1 -> v2: - further postpone setting that a choice has a value until one is indeed set - do not print symbols that are part of an invisible choice
2013-06-24kconfig: loop as long as we changed some symbols in randconfigYann E. MORIN3-6/+17
Because of choice-in-a-choice constructs, it can happen that not all symbols are assigned a value during randconfig, leading in rare cases to this situation: ---8<--- choice-in-choice.in choice bool "A/B/C" config A bool "A" config B bool "B" if B choice bool "E/F" config E bool "E" config F bool "F" endchoice endif # B config C bool "C" endchoice ---8<--- $ ./scripts/kconfig/conf --randconfig choice-in-choice.in [--SNIP--] $ ./scripts/kconfig/conf --silentoldconfig choice-in-choice.in </dev/null [--SNIP--] A/B/C 1. A (A) > 2. B (B) 3. C (C) choice[1-3]: 2 E/F > 1. E (E) (NEW) 2. F (F) (NEW) choice[1-2]: aborted! Console input/output is redirected. Run 'make oldconfig' to update configuration. Fix this by looping in randconfig for as long as some symbol gets assigned a value. Note: this was spotted with the USB EHCI Debug Device Gadget (USB_G_DBGP), which uses this choice-in-a-choice construct, and exhibits this problem. The example above is just a stripped-down minimalist test-case. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-06-24kconfig/[mn]conf: make it explicit in the search box that a regexp is possibleYann E. MORIN2-2/+2
Reported-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Jean Delvare <jdelvare@suse.de> Cc: Michal Marek <mmarek@suse.cz>
2013-06-24kconfig: sort found symbols by relevanceYann E. MORIN1-9/+69
When searching for symbols, return the symbols sorted by relevance. Sorting is done as thus: - first, symbols that match exactly - then, alphabetical sort Since the search can be a regexp, it is possible that more than one symbol matches exactly. In this case, we can't decide which to sort first, so we fallback to alphabeticall sort. Explain this (new!) sorting heuristic in the documentation. Reported-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Jean Delvare <jdelvare@suse.de> Cc: Michal Marek <mmarek@suse.cz> Cc: Roland Eggner <edvx1@systemanalysen.net> Cc: Wang YanQing <udknight@gmail.com> -- Changes v1->v2: - drop the previous, complex heuristic in favour of a simpler heuristic that is both easier to understand, *and* to maintain (Jean) - explain sorting heuristic in the doc (Jean)
2013-06-18kconfig/conf: print the seed used to initialise the RNG for randconfigYann E. MORIN1-0/+1
... so the user has a chance to reproduce a test-case. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-06-18kconfig/conf: accept a base-16 seed for randconfigYann E. MORIN1-1/+1
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-06-18kconfig/conf: fix randconfig setting multiple symbols in a choiceYann E. MORIN1-0/+3
Currently, randconfig may set more than one symbol in a given choice. Given this config file: config A bool "A" if A choice bool "B/C/D" config B bool "B" config C bool "C" config D bool "D" endchoice endif # A Then randconfig generates such .config files (case where A is not set is not shown below for brevity), and where only the right-most .config is valid: CONFIG_A=y CONFIG_A=y CONFIG_A=y CONFIG_B=y CONFIG_B=y CONFIG_B=y CONFIG_C=y # CONFIG_C is not set # CONFIG_C is not set # CONFIG_D is not set CONFIG_D=y # CONFIG_D is not set That is, in a randomised choice, the first symbol is always selected, and at most one other symbol may be selected. This is due to symbol randomised in a choice not being properly flagged as having a value. Fix that by flagging those symbols adequately: have a user-defined value, and be not valid (to force recalculation of the symbol). Note: if the choice is not conditional, then the randomisation is properly done. Reported-by: Matthieu CASTET <matthieu.castet@parrot.com> Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com> [yann.morin.1998@free.fr: independently re-done the same patch as Matthieu, as pointed out by Sedat] Cc: Arnaud Lacombe <lacombar@gmail.com> Cc: Sedat Dilek <sedat.dilek@gmail.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>