1. 01 3月, 2018 1 次提交
  2. 02 2月, 2018 1 次提交
  3. 21 1月, 2018 5 次提交
    • M
      kconfig: use default 'yy' prefix for lexer and parser · 765f4cde
      Masahiro Yamada 提交于
      Flex and Bison provide an option to change the prefix of globally-
      visible symbols.  This is useful to link multiple lexers and/or
      parsers into the same executable.  However, Kconfig (and any other
      host programs in kernel) uses a single lexer and parser.  I do not
      see a good reason to change the default 'yy' prefix.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NUlf Magnusson <ulfalizer@gmail.com>
      765f4cde
    • U
      kconfig: Warn if there is more than one help text · 6479f327
      Ulf Magnusson 提交于
      Avoids mistakes like in the following real-world example, where only the
      final help string ("Say Y...") was used. This particular example was
      fixed in commit 561b29e4 ("media: fix media Kconfig help syntax
      issues").
      
        config DVB_NETUP_UNIDVB
        	...
      	select DVB_CXD2841ER if MEDIA_SUBDRV_AUTOSELECT
        	---help---
        	  Support for NetUP PCI express Universal DVB card.
             help
        	Say Y when you want to support NetUP Dual Universal DVB card
              ...
      
      This now prints the following warning:
      
        drivers/media/pci/netup_unidvb:13: warning: 'DVB_NETUP_UNIDVB' defined with more than one help text -- only the last one will be used
      
      Also free() any extra help strings.
      Signed-off-by: NUlf Magnusson <ulfalizer@gmail.com>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      6479f327
    • M
      kconfig: drop 'boolean' keyword · b92d804a
      Masahiro Yamada 提交于
      No more users of this keyword.  Drop it according to the notice by
      commit 6341e62b ("kconfig: use bool instead of boolean for type
      definition attributes").
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: NLuis R. Rodriguez <mcgrof@kernel.org>
      b92d804a
    • U
      kconfig: Remove menu_end_entry() · df60f4b9
      Ulf Magnusson 提交于
      menu_end_entry() is empty and completely unused as far as I can tell:
      
      	$ git log -G menu_end_entry --oneline
      	a02f0570 [PATCH] kconfig: improve error handling in the parser
      	1da177e4 Linux-2.6.12-rc2
      
      Last one is the initial Git commit, where menu_end_entry() is empty as
      well. I couldn't find anything that redefined it on Google either.
      
      It might be a debugging helper for setting a breakpoint after each
      config, menuconfig, and comment is parsed. IMO it hurts more than it
      helps in that case by making the parsing code look more complicated at a
      glance than it really is, and I suspect it doesn't get used much.
      
      Tested by running the Kconfiglib test suite, which indirectly verifies
      that the .config files generated by the C implementation for each
      defconfig file in the kernel stays the same.
      Signed-off-by: NUlf Magnusson <ulfalizer@gmail.com>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      df60f4b9
    • U
      kconfig: Don't leak main menus during parsing · 0724a7c3
      Ulf Magnusson 提交于
      If a 'mainmenu' entry appeared in the Kconfig files, two things would
      leak:
      
      	- The 'struct property' allocated for the default "Linux Kernel
      	  Configuration" prompt.
      
      	- The string for the T_WORD/T_WORD_QUOTE prompt after the
      	  T_MAINMENU token, allocated on the heap in zconf.l.
      
      To fix it, introduce a new 'no_mainmenu_stmt' nonterminal that matches
      if there's no 'mainmenu' and adds the default prompt. That means the
      prompt only gets allocated once regardless of whether there's a
      'mainmenu' statement or not, and managing it becomes simple.
      
      Summary from Valgrind on 'menuconfig' (ARCH=x86) before the fix:
      
      	LEAK SUMMARY:
      	   definitely lost: 344,568 bytes in 14,352 blocks
      	   ...
      
      Summary after the fix:
      
      	LEAK SUMMARY:
      	   definitely lost: 344,440 bytes in 14,350 blocks
      	   ...
      Signed-off-by: NUlf Magnusson <ulfalizer@gmail.com>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      0724a7c3
  4. 11 1月, 2018 2 次提交
    • U
      kconfig: Don't leak 'option' arguments during parsing · bc28fe1d
      Ulf Magnusson 提交于
      The following strings would leak before this change:
      
      	- option env="LEAKED"
      	- option defconfig_list="LEAKED"
      
      These come in the form of T_WORD tokens and are always allocated on the
      heap in zconf.l. Free them.
      
      Summary from Valgrind on 'menuconfig' (ARCH=x86) before the fix:
      
      	LEAK SUMMARY:
      	   definitely lost: 344,616 bytes in 14,355 blocks
      	   ...
      
      Summary after the fix:
      
      	LEAK SUMMARY:
      	   definitely lost: 344,568 bytes in 14,352 blocks
      	   ...
      Signed-off-by: NUlf Magnusson <ulfalizer@gmail.com>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      bc28fe1d
    • U
      kconfig: Don't leak 'source' filenames during parsing · 24161a67
      Ulf Magnusson 提交于
      The 'source_stmt' nonterminal takes a 'prompt', which consists of either
      a T_WORD or a T_WORD_QUOTE, both of which are always allocated on the
      heap in zconf.l and need to have their associated strings freed. Free
      them.
      
      The existing code already makes sure to always copy the string, but add
      a warning to sym_expand_string_value() to make it clear that the string
      must be copied, just in case.
      
      Summary from Valgrind on 'menuconfig' (ARCH=x86) before the fix:
      
      	LEAK SUMMARY:
      	   definitely lost: 387,504 bytes in 15,545 blocks
      	   ...
      
      Summary after the fix:
      
      	LEAK SUMMARY:
      	   definitely lost: 344,616 bytes in 14,355 blocks
      	   ...
      Signed-off-by: NUlf Magnusson <ulfalizer@gmail.com>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      24161a67
  5. 10 1月, 2018 1 次提交
    • U
      kconfig: Don't leak symbol names during parsing · 26e47a3c
      Ulf Magnusson 提交于
      Prior to this fix, zconf.y did not free symbol names from zconf.l in
      these contexts:
      
      	- After T_CONFIG ('config LEAKED')
      	- After T_MENUCONFIG ('menuconfig LEAKED')
      	- After T_SELECT ('select LEAKED')
      	- After T_IMPLY ('imply LEAKED')
      	- After T_DEFAULT in a choice ('default LEAKED')
      
      All of these come in the form of T_WORD tokens, which always have their
      associated string allocated on the heap in zconf.l and need to be freed.
      
      Fix by introducing a new nonterminal 'nonconst_symbol' which takes a
      T_WORD, fetches the symbol, and then frees the T_WORD string. The
      already existing 'symbol' nonterminal works the same way but also
      accepts T_WORD_QUOTE, corresponding to a constant symbol. T_WORD_QUOTE
      should not be accepted in any of the contexts above, so the 'symbol'
      nonterminal can't be reused here.
      
      Fetching the symbol in 'nonconst_symbol' also removes a bunch of
      sym_lookup() calls from actions.
      
      Summary from Valgrind on 'menuconfig' (ARCH=x86) before the fix:
      
      	LEAK SUMMARY:
      	   definitely lost: 711,571 bytes in 37,756 blocks
      	   ...
      
      Summary after the fix:
      
      	LEAK SUMMARY:
      	   definitely lost: 387,504 bytes in 15,545 blocks
                 ...
      Signed-off-by: NUlf Magnusson <ulfalizer@gmail.com>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      26e47a3c
  6. 12 12月, 2017 1 次提交
  7. 20 8月, 2017 1 次提交
  8. 16 11月, 2016 1 次提交
    • N
      Kconfig: Introduce the "imply" keyword · 237e3ad0
      Nicolas Pitre 提交于
      The "imply" keyword is a weak version of "select" where the target
      config symbol can still be turned off, avoiding those pitfalls that come
      with the "select" keyword.
      
      This is useful e.g. with multiple drivers that want to indicate their
      ability to hook into a secondary subsystem while allowing the user to
      configure that subsystem out without also having to unset these drivers.
      
      Currently, the same effect can almost be achieved with:
      
      config DRIVER_A
      	tristate
      
      config DRIVER_B
      	tristate
      
      config DRIVER_C
      	tristate
      
      config DRIVER_D
      	tristate
      
      [...]
      
      config SUBSYSTEM_X
      	tristate
      	default DRIVER_A || DRIVER_B || DRIVER_C || DRIVER_D || [...]
      
      This is unwieldy to maintain especially with a large number of drivers.
      Furthermore, there is no easy way to restrict the choice for SUBSYSTEM_X
      to y or n, excluding m, when some drivers are built-in. The "select"
      keyword allows for excluding m, but it excludes n as well. Hence
      this "imply" keyword.  The above becomes:
      
      config DRIVER_A
      	tristate
      	imply SUBSYSTEM_X
      
      config DRIVER_B
      	tristate
      	imply SUBSYSTEM_X
      
      [...]
      
      config SUBSYSTEM_X
      	tristate
      
      This is much cleaner, and way more flexible than "select". SUBSYSTEM_X
      can still be configured out, and it can be set as a module when none of
      the drivers are configured in or all of them are modular.
      Signed-off-by: NNicolas Pitre <nico@linaro.org>
      Acked-by: NRichard Cochran <richardcochran@gmail.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Acked-by: NJohn Stultz <john.stultz@linaro.org>
      Reviewed-by: NJosh Triplett <josh@joshtriplett.org>
      Cc: Paul Bolle <pebolle@tiscali.nl>
      Cc: linux-kbuild@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Cc: Michal Marek <mmarek@suse.com>
      Cc: Edward Cree <ecree@solarflare.com>
      Link: http://lkml.kernel.org/r/1478841010-28605-2-git-send-email-nicolas.pitre@linaro.orgSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      237e3ad0
  9. 15 6月, 2015 1 次提交
    • J
      kconfig: allow use of relations other than (in)equality · 31847b67
      Jan Beulich 提交于
      Over the years I found it desirable to be able to use all sorts of
      relations, not just (in)equality. And apparently I'm not the only one,
      as there's at least one example in the tree where the programmer
      assumed this would work (see DEBUG_UART_8250_WORD in
      arch/arm/Kconfig.debug). Another possible use would e.g. be to fold the
      two SMP/NR_CPUS prompts into one: SMP could be promptless, simply
      depending on NR_CPUS > 1.
      
      A (desirable) side effect of this change - resulting from numeric
      values now necessarily being compared as numbers rather than as
      strings - is that comparing hex values now works as expected: Other
      than int ones (which aren't allowed to have leading zeroes), zeroes
      following the 0x prefix made them compare unequal even if their values
      were equal.
      Signed-off-by: NJan Beulich <jbeulich@suse.com>
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      31847b67
  10. 10 6月, 2014 1 次提交
  11. 05 9月, 2013 1 次提交
    • Y
      kconfig: do not special-case 'MODULES' symbol · 6902dccf
      Yann E. MORIN 提交于
      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 11097a03), 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: N"Yann E. MORIN" <yann.morin.1998@free.fr>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      6902dccf
  12. 10 6月, 2011 3 次提交
  13. 07 6月, 2011 1 次提交
  14. 22 11月, 2010 1 次提交
  15. 20 9月, 2010 2 次提交
  16. 14 4月, 2010 1 次提交
  17. 02 2月, 2010 2 次提交
    • A
      Improve kconfig symbol hashing · e66f25d7
      Andi Kleen 提交于
      While looking for something else I noticed that the symbol
      hash function used by kconfig is quite poor. It doesn't
      use any of the standard hash techniques but simply
      adds up the string and then uses power of two masking,
      which is both known to perform poorly.
      
      The current x86 kconfig has over 7000 symbols.
      
      When I instrumented it showed that the minimum hash chain
      length was 16 and a significant number of them was over
      30.
      
      It didn't help that the hash table size was only 256 buckets.
      
      This patch increases the hash table size to a larger prime
      and switches to a FNV32 hash. I played around with a couple of hash
      functions, but that one seemed to perform best with reasonable
      hash table sizes.
      
      Increasing the hash table size even further didn't
      seem like a good idea, because there are a couple of global
      walks which walk the complete hash table.
      
      I also moved the unnamed bucket to 0. It's still the longest
      of all the buckets (44 entries), but hopefully it's not
      often hit except for the global walk which doesn't care.
      
      The result is a much nicer distribution:
      (first column bucket length, second number of buckets with that length)
      
      1: 3505
      2: 1236
      3: 294
      4: 52
      5: 3
      47: 1		<--- this is the unnamed symbols bucket
      
      There are still some 5+ buckets, but increasing the hash table
      even more would be likely not worth it.
      
      This also cleans up the code slightly by removing hard coded
      magic numbers.
      
      I didn't notice a big performance difference either way
      on my Nehalem system, but I presume it'll help somewhat
      on slower systems.
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      e66f25d7
    • N
      kconfig: new configuration interface (nconfig) · 692d97c3
      nir.tzachar@gmail.com 提交于
      This patch was inspired by the kernel projects page, where an ncurses
      replacement for menuconfig was mentioned (by Sam Ravnborg).
      
      Building on menuconfig, this patch implements a more modern look
      interface using ncurses and ncurses' satellite libraries (menu, panel,
      form). The implementation does not depend on lxdialog, which is
      currently distributed with the kernel.
      Signed-off-by: NNir Tzachar <nir.tzachar@gmail.com>
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      692d97c3
  18. 16 11月, 2009 1 次提交
  19. 16 10月, 2009 1 次提交
    • J
      kconfig: Make zconf.y work with current bison · 1456edbb
      Josh Triplett 提交于
      zconf.y includes zconf.hash.c from the initial code section.
      zconf.hash.c references the token constants from zconf.y.  However,
      current bison defines the token constants after the initial code
      section, making zconf.hash.c fail to compile.  Move the include of
      zconf.hash.c later in zconf.y, so bison puts it after the token
      constants.
      Signed-off-by: NJosh Triplett <josh@joshtriplett.org>
      1456edbb
  20. 29 4月, 2008 1 次提交
    • R
      kconfig: add named choice group · 5a1aa8a1
      Roman Zippel 提交于
      As choice dependency are now fully checked, it's quite easy to add support
      for named choices. This lifts the restriction that a choice value can only
      appear once, although it still has to be within the same group,
      but multiple choices can be joined by giving them a name.
      While at it I cleaned up a little the choice type logic to simplify it a
      bit.
      Signed-off-by: NRoman Zippel <zippel@linux-m68k.org>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      5a1aa8a1
  21. 13 10月, 2007 1 次提交
    • A
      kconfig: syntax cleanup - drop support for "depends/requires/def_boolean" · 247537b9
      Adrian Bunk 提交于
      Remove the following redundant and never or rarely used kconfig syntax:
      
      - "def_boolean" (same as "def_bool")
      - "requires" (same as "depends on")
      - "depends" (same as "depends on")
      
      This patch contains the code changes and Kconfig updates.
      The shipped files are in next patch to let actual codechange stand out.
      Signed-off-by: NAdrian Bunk <bunk@kernel.org>
      Cc: "Randy.Dunlap" <rdunlap@xenotime.net>
      Cc: Bryan Wu <bryan.wu@analog.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Dmitry Torokhov <dtor@mail.ru>
      Cc: "John W. Linville" <linville@tuxdriver.com>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      Cc: Richard Purdie <rpurdie@rpsys.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      247537b9
  22. 26 7月, 2007 1 次提交
    • S
      kconfig: attach help text to menus · 03d29122
      Sam Ravnborg 提交于
      Roman Zippel wrote:
      > A simple example would be
      > help texts, right now they are per symbol, but they should really be per
      > menu, so archs can provide different help texts for something.
      
      This patch does this and at the same time introduce a few API
      funtions used to access the help text.
      
      The relevant api functions are introduced in the various frontends.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      03d29122
  23. 06 5月, 2007 1 次提交
    • S
      kconfig: error out if recursive dependencies are found · 5447d34b
      Sam Ravnborg 提交于
      Sample:
      config FOO
      	bool "This is foo"
      	depends on BAR
      
      config BAR
      	bool "This is bar"
      	depends on FOO
      
      This will result in following error message:
      error: found recursive dependency: FOO -> BAR -> FOO
      
      And will then exit with exit code equal 1 so make will stop.
      Inspired by patch from: Adrian Bunk <bunk@stusta.de>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Adrian Bunk <bunk@stusta.de>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      5447d34b
  24. 14 12月, 2006 1 次提交
  25. 09 6月, 2006 2 次提交
  26. 09 11月, 2005 4 次提交
  27. 29 7月, 2005 1 次提交