1. 14 8月, 2018 1 次提交
  2. 18 7月, 2018 1 次提交
  3. 28 6月, 2018 1 次提交
  4. 26 3月, 2018 2 次提交
    • M
      kconfig: make unmet dependency warnings readable · f8f69dc0
      Masahiro Yamada 提交于
      Currently, the unmet dependency warnings end up with endlessly long
      expressions, most of which are false positives.
      
      Here is test code to demonstrate how it currently works.
      
      [Test Case]
      
        config DEP1
                def_bool y
      
        config DEP2
                bool "DEP2"
      
        config A
                bool "A"
                select E
      
        config B
                bool "B"
                depends on DEP2
                select E
      
        config C
                bool "C"
                depends on DEP1 && DEP2
                select E
      
        config D
                def_bool n
                select E
      
        config E
                bool
                depends on DEP1 && DEP2
      
      [Result]
      
        $ make config
        scripts/kconfig/conf  --oldaskconfig Kconfig
        *
        * Linux Kernel Configuration
        *
        DEP2 (DEP2) [N/y/?] (NEW) n
        A (A) [N/y/?] (NEW) y
        warning: (A && B && D) selects E which has unmet direct
        dependencies (DEP1 && DEP2)
      
      Here, I see some points to be improved.
      
      First, '(A || B || D)' would make more sense than '(A && B && D)'.
      I am not sure if this is intentional, but expr_simplify_unmet_dep()
      turns OR expressions into AND, like follows:
      
              case E_OR:
                      return expr_alloc_and(
      
      Second, we see false positives.  'A' is a real unmet dependency.
      'B' is false positive because 'DEP1' is fixed to 'y', and 'B' depends
      on 'DEP2'.  'C' was correctly dropped by expr_simplify_unmet_dep().
      'D' is also false positive because it has no chance to be enabled.
      Current expr_simplify_unmet_dep() cannot avoid those false positives.
      
      After all, I decided to use the same helpers as used for printing
      reverse dependencies in the help.
      
      With this commit, unreadable warnings (most of the reported symbols are
      false positives) in the real world:
      
      $ make ARCH=score allyesconfig
      scripts/kconfig/conf  --allyesconfig Kconfig
      warning: (HWSPINLOCK_QCOM && AHCI_MTK && STMMAC_PLATFORM &&
       DWMAC_IPQ806X && DWMAC_LPC18XX && DWMAC_OXNAS && DWMAC_ROCKCHIP &&
       DWMAC_SOCFPGA && DWMAC_STI && TI_CPSW && PINCTRL_GEMINI &&
       PINCTRL_OXNAS && PINCTRL_ROCKCHIP && PINCTRL_DOVE &&
       PINCTRL_ARMADA_37XX && PINCTRL_STM32 && S3C2410_WATCHDOG &&
       VIDEO_OMAP3 && VIDEO_S5P_FIMC && USB_XHCI_MTK && RTC_DRV_AT91SAM9 &&
       LPC18XX_DMAMUX && VIDEO_OMAP4 && COMMON_CLK_GEMINI &&
       COMMON_CLK_ASPEED && COMMON_CLK_NXP && COMMON_CLK_OXNAS &&
       COMMON_CLK_BOSTON && QCOM_ADSP_PIL && QCOM_Q6V5_PIL && QCOM_GSBI &&
       ATMEL_EBI && ST_IRQCHIP && RESET_IMX7 && PHY_HI6220_USB &&
       PHY_RALINK_USB && PHY_ROCKCHIP_PCIE && PHY_DA8XX_USB) selects
       MFD_SYSCON which has unmet direct dependencies (HAS_IOMEM)
      warning: (PINCTRL_AT91 && PINCTRL_AT91PIO4 && PINCTRL_OXNAS &&
       PINCTRL_PISTACHIO && PINCTRL_PIC32 && PINCTRL_MESON &&
       PINCTRL_NOMADIK && PINCTRL_MTK && PINCTRL_MT7622 && GPIO_TB10X)
       selects OF_GPIO which has unmet direct dependencies (GPIOLIB && OF &&
       HAS_IOMEM)
      warning: (FAULT_INJECTION_STACKTRACE_FILTER && LATENCYTOP && LOCKDEP)
       selects FRAME_POINTER which has unmet direct dependencies
       (DEBUG_KERNEL && (CRIS || M68K || FRV || UML || SUPERH || BLACKFIN ||
       MN10300 || METAG) || ARCH_WANT_FRAME_POINTERS)
      
      will be turned into:
      
      $ make ARCH=score allyesconfig
      scripts/kconfig/conf  --allyesconfig Kconfig
      
      WARNING: unmet direct dependencies detected for MFD_SYSCON
        Depends on [n]: HAS_IOMEM [=n]
        Selected by [y]:
        - PINCTRL_STM32 [=y] && PINCTRL [=y] && (ARCH_STM32 ||
       COMPILE_TEST [=y]) && OF [=y]
        - RTC_DRV_AT91SAM9 [=y] && RTC_CLASS [=y] && (ARCH_AT91 ||
       COMPILE_TEST [=y])
        - RESET_IMX7 [=y] && RESET_CONTROLLER [=y]
        - PHY_HI6220_USB [=y] && (ARCH_HISI && ARM64 ||
       COMPILE_TEST [=y])
        - PHY_RALINK_USB [=y] && (RALINK || COMPILE_TEST [=y])
        - PHY_ROCKCHIP_PCIE [=y] && (ARCH_ROCKCHIP && OF [=y] ||
       COMPILE_TEST [=y])
      
      WARNING: unmet direct dependencies detected for OF_GPIO
        Depends on [n]: GPIOLIB [=y] && OF [=y] && HAS_IOMEM [=n]
        Selected by [y]:
        - PINCTRL_MTK [=y] && PINCTRL [=y] && (ARCH_MEDIATEK ||
       COMPILE_TEST [=y]) && OF [=y]
        - PINCTRL_MT7622 [=y] && PINCTRL [=y] && (ARCH_MEDIATEK ||
       COMPILE_TEST [=y]) && OF [=y] && (ARM64 || COMPILE_TEST [=y])
      
      WARNING: unmet direct dependencies detected for FRAME_POINTER
        Depends on [n]: DEBUG_KERNEL [=y] && (CRIS || M68K || FRV || UML ||
       SUPERH || BLACKFIN || MN10300 || METAG) || ARCH_WANT_FRAME_POINTERS [=n]
        Selected by [y]:
        - LATENCYTOP [=y] && DEBUG_KERNEL [=y] && STACKTRACE_SUPPORT [=y] &&
       PROC_FS [=y] && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND &&
       !ARC && !X86
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NPetr Vorel <petr.vorel@gmail.com>
      f8f69dc0
    • E
      kconfig: Print reverse dependencies in groups · d9119b59
      Eugeniu Rosca 提交于
      Surprisingly or not, disabling a CONFIG option (which is assumed to
      be unneeded) may be not so trivial. Especially it is not trivial, when
      this CONFIG option is selected by a dozen of other configs. Before the
      moment commit 1ccb2714 ("kconfig: make "Selected by:" and
      "Implied by:" readable") popped up in v4.16-rc1, it was an absolute pain
      to break down the "Selected by" reverse dependency expression in order
      to identify all those configs which select (IOW *do not allow
      disabling*) a certain feature (assumed to be not needed).
      
      This patch tries to make one step further by putting at users'
      fingertips the revdep top level OR sub-expressions grouped/clustered by
      the tristate value they evaluate to. This should allow the users to
      directly concentrate on and tackle the _active_ reverse dependencies.
      
      To give some numbers and quantify the complexity of certain reverse
      dependencies, assuming commit 617aebe6 ("Merge tag
      'usercopy-v4.16-rc1' of
      git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux"), ARCH=arm64
      and vanilla arm64 defconfig, here is the top 10 CONFIG options with
      the highest amount of top level "||" sub-expressions/tokens that make
      up the final "Selected by" reverse dependency expression.
      
      | Config            | All revdep | Active revdep |
      |-------------------|------------|---------------|
      | REGMAP_I2C        | 212        | 9             |
      | CRC32             | 167        | 25            |
      | FW_LOADER         | 128        | 5             |
      | MFD_CORE          | 124        | 9             |
      | FB_CFB_IMAGEBLIT  | 114        | 2             |
      | FB_CFB_COPYAREA   | 111        | 2             |
      | FB_CFB_FILLRECT   | 110        | 2             |
      | SND_PCM           | 103        | 2             |
      | CRYPTO_HASH       | 87         | 19            |
      | WATCHDOG_CORE     | 86         | 6             |
      
      The story behind the above is that users need to visually
      review/evaluate 212 expressions which *potentially* select REGMAP_I2C
      in order to identify the expressions which *actually* select REGMAP_I2C,
      for a particular ARCH and for a particular defconfig used.
      
      To make this experience smoother, change the way reverse dependencies
      are displayed to the user from [1] to [2].
      
      [1] Old representation of DMA_ENGINE_RAID:
        Selected by:
        - AMCC_PPC440SPE_ADMA [=n] && DMADEVICES [=y] && (440SPe || 440SP)
        - BCM_SBA_RAID [=m] && DMADEVICES [=y] && (ARM64 [=y] || ...
        - FSL_RAID [=n] && DMADEVICES [=y] && FSL_SOC && ...
        - INTEL_IOATDMA [=n] && DMADEVICES [=y] && PCI [=y] && X86_64
        - MV_XOR [=n] && DMADEVICES [=y] && (PLAT_ORION || ARCH_MVEBU [=y] ...
        - MV_XOR_V2 [=y] && DMADEVICES [=y] && ARM64 [=y]
        - XGENE_DMA [=n] && DMADEVICES [=y] && (ARCH_XGENE [=y] || ...
        - DMATEST [=n] && DMADEVICES [=y] && DMA_ENGINE [=y]
      
      [2] New representation of DMA_ENGINE_RAID:
        Selected by [y]:
        - MV_XOR_V2 [=y] && DMADEVICES [=y] && ARM64 [=y]
        Selected by [m]:
        - BCM_SBA_RAID [=m] && DMADEVICES [=y] && (ARM64 [=y] || ...
        Selected by [n]:
        - AMCC_PPC440SPE_ADMA [=n] && DMADEVICES [=y] && (440SPe || ...
        - FSL_RAID [=n] && DMADEVICES [=y] && FSL_SOC && ...
        - INTEL_IOATDMA [=n] && DMADEVICES [=y] && PCI [=y] && X86_64
        - MV_XOR [=n] && DMADEVICES [=y] && (PLAT_ORION || ARCH_MVEBU [=y] ...
        - XGENE_DMA [=n] && DMADEVICES [=y] && (ARCH_XGENE [=y] || ...
        - DMATEST [=n] && DMADEVICES [=y] && DMA_ENGINE [=y]
      Suggested-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: NEugeniu Rosca <erosca@de.adit-jv.com>
      Reviewed-by: NPetr Vorel <pvorel@suse.cz>
      Reviewed-by: NUlf Magnusson <ulfalizer@gmail.com>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      d9119b59
  5. 25 1月, 2018 1 次提交
    • P
      kconfig: make "Selected by:" and "Implied by:" readable · 1ccb2714
      Petr Vorel 提交于
      Reverse dependency expressions can get rather unwieldy, especially if
      a symbol is selected by more than a handful of other symbols. I.e. it's
      possible to have near endless expressions like:
         A && B && !C || D || F && (G || H) || [...]
      
      Chop these expressions into actually readable chunks:
         - A && B && !C
         - D
         - F && (G || H)
         - [...]
      
      I.e. transform the top level OR tokens into newlines and prepend each
      line with a minus. This makes the "Selected by:" and "Implied by:" blurb
      much easier to read. This is done only if there is more than one top
      level OR. "Depends on:" and "Range :" were deliberately left as they are.
      
      Based on idea from Paul Bolle.
      Suggested-by: NPaul Bolle <pebolle@tiscali.nl>
      Signed-off-by: NPetr Vorel <petr.vorel@gmail.com>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      1ccb2714
  6. 07 12月, 2017 2 次提交
  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. 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
  9. 25 2月, 2015 1 次提交
  10. 08 4月, 2014 1 次提交
  11. 09 10月, 2013 1 次提交
  12. 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
  13. 25 10月, 2012 1 次提交
  14. 28 9月, 2012 2 次提交
  15. 15 1月, 2012 1 次提交
  16. 07 6月, 2011 1 次提交
  17. 15 4月, 2011 1 次提交
  18. 28 12月, 2010 1 次提交
  19. 22 12月, 2010 1 次提交
    • M
      kconfig: Make expr_copy() take a const argument · 17742dc7
      Michal Marek 提交于
      Fixes
      scripts/kconfig/expr.c: In function ‘expr_get_leftmost_symbol’:
      scripts/kconfig/expr.c:1026:2: warning: passing argument 1 of ‘expr_copy’ discards qualifiers from pointer target type
      scripts/kconfig/expr.c:67:14: note: expected ‘struct expr *’ but argument is of type ‘const struct expr *’
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      17742dc7
  20. 22 11月, 2010 1 次提交
  21. 04 10月, 2010 1 次提交
  22. 20 9月, 2010 1 次提交
  23. 03 8月, 2010 1 次提交
  24. 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
  25. 02 2月, 2010 1 次提交
    • 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
  26. 03 1月, 2009 3 次提交
  27. 29 1月, 2008 4 次提交
  28. 26 7月, 2007 2 次提交
  29. 09 6月, 2006 3 次提交