1. 10 2月, 2018 1 次提交
  2. 09 2月, 2018 2 次提交
    • M
      kconfig: send error messages to stderr · 9e3e10c7
      Masahiro Yamada 提交于
      These messages should be directed to stderr.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NUlf Magnusson <ulfalizer@gmail.com>
      9e3e10c7
    • M
      kconfig: do not write choice values when their dependency becomes n · cb67ab2c
      Masahiro Yamada 提交于
      "# CONFIG_... is not set" for choice values are wrongly written into
      the .config file if they are once visible, then become invisible later.
      
        Test case
        ---------
      
      ---------------------------(Kconfig)----------------------------
      config A
      	bool "A"
      
      choice
      	prompt "Choice ?"
      	depends on A
      
      config CHOICE_B
      	bool "Choice B"
      
      config CHOICE_C
      	bool "Choice C"
      
      endchoice
      ----------------------------------------------------------------
      
      ---------------------------(.config)----------------------------
      CONFIG_A=y
      ----------------------------------------------------------------
      
      With the Kconfig and .config above,
      
        $ make config
        scripts/kconfig/conf  --oldaskconfig Kconfig
        *
        * Linux Kernel Configuration
        *
        A (A) [Y/n] n
        #
        # configuration written to .config
        #
        $ cat .config
        #
        # Automatically generated file; DO NOT EDIT.
        # Linux Kernel Configuration
        #
        # CONFIG_A is not set
        # CONFIG_CHOICE_B is not set
        # CONFIG_CHOICE_C is not set
      
      Here,
      
        # CONFIG_CHOICE_B is not set
        # CONFIG_CHOICE_C is not set
      
      should not be written into the .config file because their dependency
      "depends on A" is unmet.
      
      Currently, there is no code that clears SYMBOL_WRITE of choice values.
      
      Clear SYMBOL_WRITE for all symbols in sym_calc_value(), then set it
      again after calculating visibility.  To simplify the logic, set the
      flag if they have non-n visibility, regardless of types, and regardless
      of whether they are choice values or not.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NUlf Magnusson <ulfalizer@gmail.com>
      cb67ab2c
  3. 21 1月, 2018 1 次提交
  4. 11 1月, 2018 1 次提交
    • 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. 16 12月, 2017 1 次提交
    • M
      kconfig: display recursive dependency resolution hint just once · e3b03bf2
      Masahiro Yamada 提交于
      Commit 1c199f28 ("kbuild: document recursive dependency limitation
      / resolution") probably intended to show a hint along with "recursive
      dependency detected!" error, but it missed to add {...} guard, and the
      hint is displayed in every loop of the dep_stack traverse, annoyingly.
      
      This error was detected by GCC's -Wmisleading-indentation when switching
      to build-time generation of lexer/parser.
      
      scripts/kconfig/symbol.c: In function ‘sym_check_print_recursive’:
      scripts/kconfig/symbol.c:1150:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
         if (stack->sym == last_sym)
         ^~
      scripts/kconfig/symbol.c:1153:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
          fprintf(stderr, "For a resolution refer to Documentation/kbuild/kconfig-language.txt\n");
          ^~~~~~~
      
      I could simply add {...} to surround the three fprintf(), but I rather
      chose to move the hint after the loop to make the whole message readable.
      
      Fixes: 1c199f28 ("kbuild: document recursive dependency limitation / resolution"
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: NLuis R. Rodriguez <mcgrof@kernel.org>
      e3b03bf2
  6. 23 11月, 2017 1 次提交
  7. 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
  8. 11 5月, 2016 1 次提交
    • D
      kconfig/symbol.c: handle choice_values that depend on 'm' symbols · fa64e5f6
      Dirk Gouders 提交于
      If choices consist of choice_values of type tristate that depend on
      symbols set to 'm', those choice_values are not set to 'n' if the
      choice is changed from 'm' to 'y' (in which case only one active
      choice_value is allowed). Those values are also written to the config
      file causing modules to be built when they should not.
      
      The following config can be used to reproduce and examine the problem;
      with the frontend of your choice set "Choice 0" and "Choice 1" to 'm',
      then set "Tristate Choice" to 'y' and save the configuration:
      
      config modules
      	boolean modules
      	default y
      	option modules
      
      config dependency
      	tristate "Dependency"
      	default m
      
      choice
      	prompt "Tristate Choice"
      	default choice0
      
      config choice0
      	tristate "Choice 0"
      
      config choice1
      	tristate "Choice 1"
      	depends on dependency
      
      endchoice
      
      This patch sets tristate choice_values' visibility that depend on
      symbols set to 'm' to 'n' if the corresponding choice is set to 'y'.
      
      This makes them disappear from the choice list and will also cause the
      choice_values' value set to 'n' in sym_calc_value() and as a result
      they are written as "not set" to the resulting .config file.
      Reported-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NDirk Gouders <dirk@gouders.net>
      Tested-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Tested-by: NRoger Quadros <rogerq@ti.com>
      Signed-off-by: NMichal Marek <mmarek@suse.com>
      fa64e5f6
  9. 08 10月, 2015 1 次提交
    • L
      kbuild: document recursive dependency limitation / resolution · 1c199f28
      Luis R. Rodriguez 提交于
      Recursive dependency issues with kconfig are unavoidable due to
      some limitations with kconfig, since these issues are recurring
      provide a hint to the user how they can resolve these dependency
      issues and also document why such limitation exists.
      
      While at it also document a bit of future prospects of ways to
      enhance Kconfig, including providing formal semantics and evaluation
      of use of a SAT solver. If you're interested in this work or prospects
      of it check out the kconfig-sat project wiki [0] and mailing list [1].
      
      [0] http://kernelnewbies.org/KernelProjects/kconfig-sat
      [1] https://groups.google.com/d/forum/kconfig-sat
      
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: James Bottomley <jbottomley@odin.com>
      Cc: Josh Triplett <josh@joshtriplett.org>
      Cc: Paul Bolle <pebolle@tiscali.nl>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Mate Soos <soos.mate@gmail.com>
      Signed-off-by: NLuis R. Rodriguez <mcgrof@suse.com>
      Signed-off-by: NMichal Marek <mmarek@suse.com>
      1c199f28
  10. 19 8月, 2015 1 次提交
  11. 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
  12. 25 2月, 2015 1 次提交
  13. 09 10月, 2013 1 次提交
  14. 16 8月, 2013 1 次提交
  15. 17 7月, 2013 4 次提交
  16. 29 6月, 2013 1 次提交
  17. 25 6月, 2013 1 次提交
    • Y
      kconfig: sort found symbols by relevance · 193b40ae
      Yann E. MORIN 提交于
      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: NJean Delvare <jdelvare@suse.de>
      Signed-off-by: N"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)
      193b40ae
  18. 16 6月, 2013 1 次提交
    • A
      kconfig: Fix defconfig when one choice menu selects options that another choice menu depends on · fbe98bb9
      Arve Hjønnevåg 提交于
      The defconfig and Kconfig combination below, which is based on 3.10-rc4
      Kconfigs, resulted in several options getting set to "m" instead of "y".
      
      defconfig.choice:
      ---8<---
      CONFIG_MODULES=y
      CONFIG_USB_ZERO=y
      ---8<---
      
      Kconfig.choice:
      ---8<---
      menuconfig MODULES
      	bool "Enable loadable module support"
      
      config CONFIGFS_FS
      	tristate "Userspace-driven configuration filesystem"
      
      config OCFS2_FS
              tristate "OCFS2 file system support"
              depends on CONFIGFS_FS
              select CRC32
      
      config USB_LIBCOMPOSITE
      	tristate
      	select CONFIGFS_FS
      
      choice
      	tristate "USB Gadget Drivers"
      	default USB_ETH
      
      config USB_ZERO
      	tristate "Gadget Zero (DEVELOPMENT)"
      	select USB_LIBCOMPOSITE
      
      config USB_ETH
      	tristate "Ethernet Gadget (with CDC Ethernet support)"
      	select USB_LIBCOMPOSITE
      
      endchoice
      
      config CRC32
              tristate "CRC32/CRC32c functions"
              default y
      
      choice
              prompt "CRC32 implementation"
              depends on CRC32
              default CRC32_SLICEBY8
      
      config CRC32_SLICEBY8
              bool "Slice by 8 bytes"
      
      endchoice
      ---8<---
      
      $ scripts/kconfig/conf --defconfig=defconfig.choice Kconfig.choice
      
      would result in:
      
      .config:
      ---8<---
      CONFIG_MODULES=y
      CONFIG_CONFIGFS_FS=m
      CONFIG_USB_LIBCOMPOSITE=m
      CONFIG_USB_ZERO=m
      CONFIG_CRC32=y
      CONFIG_CRC32_SLICEBY8=y
      ---8<---
      
      when the expected result would be:
      
      .config:
      ---8<---
      CONFIG_MODULES=y
      CONFIG_CONFIGFS_FS=y
      CONFIG_USB_LIBCOMPOSITE=y
      CONFIG_USB_ZERO=y
      CONFIG_CRC32=y
      CONFIG_CRC32_SLICEBY8=y
      ---8<---
      Signed-off-by: NArve Hjønnevåg <arve@android.com>
      [yann.morin.1998@free.fr: add the resulting .config to commit log,
                                remove unneeded USB_GADGET from the defconfig]
      Tested-by: N"Yann E. MORIN" <yann.morin.1998@free.fr>
      Reviewed-by: N"Yann E. MORIN" <yann.morin.1998@free.fr>
      Signed-off-by: NYann E. MORIN <yann.morin.1998@free.fr>
      fbe98bb9
  19. 20 11月, 2012 1 次提交
  20. 26 1月, 2012 1 次提交
    • A
      kconfig: fix new choices being skipped upon config update · 5d09598d
      Arnaud Lacombe 提交于
      Running `oldconfig' after any of the following configuration change:
      
      either trivial addition, such as:
      
      config A
      	bool "A"
      
      choice
      	prompt "Choice ?"
      	depends on A
      
      	config CHOICE_B
      		bool "Choice B"
      
      	config CHOICE_C
      		bool "Choice C"
      endchoice
      
      or more tricky change:
      
      OLD KCONFIG                      |  NEW KCONFIG
                                       |
                                       |  config A
                                       |          bool "A"
                                       |
      choice                           |  choice
              prompt "Choice ?"        |          prompt "Choice ?"
                                       |
              config CHOICE_C          |          config CHOICE_C
                      bool "Choice C"  |                  bool "Choice C"
                                       |
              config CHOICE_D          |          config CHOICE_D
                      bool "Choice D"  |                  bool "Choice D"
      endchoice                        |
                                       |          config CHOICE_E
                                       |                  bool "Choice E"
                                       |                  depends on A
                                       |  endchoice
      
      will not cause the choice to be considered as NEW, and thus not be
      asked. The cause of this behavior is that choice's novelty are computed
      statically right after the saved configuration has been read. At this
      point, the new dependency's value is still unknown and asserted to be
      `no'. Moreover, no update to this decision is made afterward.
      
      Correct this by dynamically evaluating a choice's novelty, and removing the
      static evaluation.
      Reported-and-tested-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: NArnaud Lacombe <lacombar@gmail.com>
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      5d09598d
  21. 01 7月, 2011 1 次提交
    • A
      kconfig: introduce specialized printer · e54e692b
      Arnaud Lacombe 提交于
      Make conf_write_symbol() grammar agnostic to be able to use it from different
      code path. These path pass a printer callback which will print a symbol's name
      and its value in different format.
      
      conf_write_symbol()'s job become mostly only to prepare a string for the
      printer. This avoid to have to pass specialized flag to generic
      functions
      Signed-off-by: NArnaud Lacombe <lacombar@gmail.com>
      [mmarek: rebased on top of de125187 (kconfig: autogenerated config_is_xxx
      macro)]
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      e54e692b
  22. 07 6月, 2011 1 次提交
  23. 22 12月, 2010 1 次提交
    • A
      kconfig: simplify select-with-unmet-direct-dependency warning · 1137c56b
      Arnaud Lacombe 提交于
      This is an attempt to simplify the expressing printed by kconfig when a
      symbol is selected but still has direct unmet dependency.
      
      First, the symbol reverse dependency is split in sub-expression. Then,
      each sub-expression is checked to ensure that it does not contains the
      unmet dependency. This removes the false-positive symbols and fixed symbol
      which already have the correct dependency. Finally, only the symbol
      responsible of the "select" is printed, instead of its full dependency tree.
      
      CC: Catalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NArnaud Lacombe <lacombar@gmail.com>
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      1137c56b
  24. 15 12月, 2010 1 次提交
  25. 02 11月, 2010 1 次提交
  26. 12 10月, 2010 1 次提交
  27. 10 10月, 2010 1 次提交
  28. 01 10月, 2010 1 次提交
  29. 20 9月, 2010 1 次提交
  30. 15 8月, 2010 1 次提交
  31. 03 8月, 2010 4 次提交
    • S
      kconfig: add savedefconfig · 7cf3d73b
      Sam Ravnborg 提交于
      savedefconfig will save a minimal config to a file
      named "defconfig".
      
      The config symbols are saved in the same order as
      they appear in the menu structure so it should
      be possible to map them to the relevant menus
      if desired.
      
      The implementation was tested against several minimal
      configs for arm which was created using brute-force.
      
      There was one regression related to default numbers
      which had their valid range further limited by another symbol.
      
      Sample:
      
      config FOO
      	int "foo"
      	default 4
      
      config BAR
      	int "bar"
      	range 0 FOO
      
      If FOO is set to 3 then BAR cannot take a value higher than 3.
      But the current implementation will set BAR equal to 4.
      
      This is seldomly used and the final configuration is OK,
      and the fix was non-trivial.
      So it was documented in the code and left as is.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Acked-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      7cf3d73b
    • S
      kconfig: refactor code in symbol.c · c252147d
      Sam Ravnborg 提交于
      Move logic to determine default for a choice to
      a separate function.
      No functional changes.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      c252147d
    • R
      kconfig: print more info when we see a recursive dependency · d595cea6
      Roman Zippel 提交于
      Consider following kconfig file:
      
      config TEST1
      	bool "test 1"
      	depends on TEST2
      
      config TEST2
      	bool "test 2"
      	depends on TEST1
      
      Previously kconfig would report:
      
      foo:6:error: found recursive dependency: TEST2 -> TEST1 -> TEST2
      
      With the following patch kconfig reports:
      foo:5:error: recursive dependency detected!
      foo:5:  symbol TEST2 depends on TEST1
      foo:1:  symbol TEST1 depends on TEST2
      
      Note that we now report where the offending symbols are defined.
      This can be a great help for complex situations involving
      several files.
      
      Patch is originally from Roman Zippel with a few adjustments by Sam.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      d595cea6
    • S
      kconfig: save location of config symbols · 59e89e3d
      Sam Ravnborg 提交于
      When we add a new config symbol save the file/line
      so we later can refer to their location.
      
      The information is saved as a property to a config symbol
      because we may have multiple definitions of the same symbol.
      
      This has the side-effect that a symbol always has
      at least one property.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      59e89e3d
  32. 08 7月, 2010 1 次提交
  33. 02 7月, 2010 1 次提交
    • C
      kbuild: Warn on selecting symbols with unmet direct dependencies · 246cf9c2
      Catalin Marinas 提交于
      The "select" statement in Kconfig files allows the enabling of options
      even if they have unmet direct dependencies (i.e. "depends on" expands
      to "no"). Currently, the "depends on" clauses are used in calculating
      the visibility but they do not affect the reverse dependencies in any
      way.
      
      The patch introduces additional tracking of the "depends on" statements
      and prints a warning on selecting an option if its direct dependencies
      are not met.
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      246cf9c2