<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/scripts/kconfig/symbol.c, branch v4.20.5</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.20.5</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.20.5'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2018-08-22T14:21:39+00:00</updated>
<entry>
<title>kconfig: improve the recursive dependency report</title>
<updated>2018-08-22T14:21:39+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2018-08-15T05:59:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f498926c47aa7d4f1b6d08af2ba16f3cf8fcb151'/>
<id>urn:sha1:f498926c47aa7d4f1b6d08af2ba16f3cf8fcb151</id>
<content type='text'>
This commit improves the messages of the recursive dependency.
Currently, sym-&gt;dir_dep.expr is not checked.  Hence, any dependency
in property visibility is regarded as the dependency of the symbol.

[Test Code 1]

  config A
          bool "a"
          depends on B

  config B
          bool "b"
          depends on A

[Test Code 2]

  config A
          bool "a" if B

  config B
          bool "b"
          depends on A

For both cases above, the same message is displayed:

        symbol B depends on A
        symbol A depends on B

This commit changes the message for the latter, like this:

        symbol B depends on A
        symbol A prompt is visible depending on B

Also, 'select' and 'imply' are distinguished.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Tested-by: Dirk Gouders &lt;dirk@gouders.net&gt;
</content>
</entry>
<entry>
<title>kconfig: report recursive dependency involving 'imply'</title>
<updated>2018-08-22T14:21:39+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2018-08-15T05:59:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5e8c5299d31519e0327be1020f309fa62dc53036'/>
<id>urn:sha1:5e8c5299d31519e0327be1020f309fa62dc53036</id>
<content type='text'>
Currently, Kconfig does not complain about the recursive dependency
where 'imply' keywords are involved.

[Test Code]

  config A
          bool "a"

  config B
          bool "b"
          imply A
          depends on A

In the code above, Kconfig cannot calculate the symbol values correctly
due to the circular dependency.  For example, allyesconfig followed by
syncconfig results in an odd behavior because CONFIG_B becomes visible
in syncconfig.

  $ make allyesconfig
  scripts/kconfig/conf  --allyesconfig Kconfig
  #
  # configuration written to .config
  #
  $ cat .config
  #
  # Automatically generated file; DO NOT EDIT.
  # Main menu
  #
  CONFIG_A=y
  $ make syncconfig
  scripts/kconfig/conf  --syncconfig Kconfig
  *
  * Restart config...
  *
  *
  * Main menu
  *
  a (A) [Y/n/?] y
    b (B) [N/y/?] (NEW)

To detect this correctly, sym_check_expr_deps() should recurse to
not only sym-&gt;rev_dep.expr but also sym-&gt;implied.expr .

At this moment, sym_check_print_recursive() cannot distinguish
'select' and 'imply' since it does not know the precise context
where the recursive dependency has been hit.  This will be solved
by the next commit.

In fact, even the document and the unit-test are confused.  Using
'imply' does not solve recursive dependency since 'imply' addresses
the unmet direct dependency, which 'select' could cause.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Tested-by: Dirk Gouders &lt;dirk@gouders.net&gt;
</content>
</entry>
<entry>
<title>kconfig: error out when seeing recursive dependency</title>
<updated>2018-08-22T14:21:38+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2018-08-15T05:59:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f1575595d15657bd78c139978107deabec5a3959'/>
<id>urn:sha1:f1575595d15657bd78c139978107deabec5a3959</id>
<content type='text'>
Originally, recursive dependency was a fatal error for Kconfig
because Kconfig cannot compute symbol values in such a situation.

Commit d595cea62403 ("kconfig: print more info when we see a recursive
dependency") changed it to a warning, which I guess was not intentional.

Get it back to an error again.

Also, rename the unit test directory "warn_recursive_dep" to
"err_recursive_dep" so that it matches to the behavior.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Tested-by: Dirk Gouders &lt;dirk@gouders.net&gt;
</content>
</entry>
<entry>
<title>kconfig: remove P_ENV property type</title>
<updated>2018-08-14T00:01:47+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2018-08-13T16:48:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1880861226c13ddd42c34ddd30c3b502b650fe29'/>
<id>urn:sha1:1880861226c13ddd42c34ddd30c3b502b650fe29</id>
<content type='text'>
This property is not set by anyone since commit 104daea149c4 ("kconfig:
reference environment variables directly and remove 'option env='").

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Acked-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
</content>
</entry>
<entry>
<title>kconfig: remove unused sym_get_env_prop() function</title>
<updated>2018-08-13T23:59:57+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2018-08-13T16:48:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c151272d1687ce2a379a93bf848080f9a42f1cef'/>
<id>urn:sha1:c151272d1687ce2a379a93bf848080f9a42f1cef</id>
<content type='text'>
This function is unused since commit 104daea149c4 ("kconfig: reference
environment variables directly and remove 'option env='").

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Acked-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
</content>
</entry>
<entry>
<title>kconfig: rename SYMBOL_AUTO to SYMBOL_NO_WRITE</title>
<updated>2018-07-17T16:18:09+00:00</updated>
<author>
<name>Dirk Gouders</name>
<email>dirk@gouders.net</email>
</author>
<published>2018-07-03T12:43:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=693359f7ac9012778590a370d076b13db704255e'/>
<id>urn:sha1:693359f7ac9012778590a370d076b13db704255e</id>
<content type='text'>
Over time, the use of the flag SYMBOL_AUTO changed from initially
marking three automatically generated symbols ARCH, KERNELRELEASE and
UNAME_RELEASE to today's effect of protecting symbols from being
written out.

Currently, only symbols of type CHOICE and those with option
defconf_list set have that flag set.

Reflect that change in semantics in the flag's name.

Signed-off-by: Dirk Gouders &lt;dirk@gouders.net&gt;
Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
</content>
</entry>
<entry>
<title>kconfig: remove sym_expand_string_value()</title>
<updated>2018-05-28T18:31:19+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2018-05-28T09:21:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5b31a9746756ea76b08be035b49c86319973b395'/>
<id>urn:sha1:5b31a9746756ea76b08be035b49c86319973b395</id>
<content type='text'>
There is no more caller of sym_expand_string_value().

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
</entry>
<entry>
<title>kconfig: reference environment variables directly and remove 'option env='</title>
<updated>2018-05-28T18:28:58+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2018-05-28T09:21:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=104daea149c45cc84842ce77a9bd6436d19f3dd8'/>
<id>urn:sha1:104daea149c45cc84842ce77a9bd6436d19f3dd8</id>
<content type='text'>
To get access to environment variables, Kconfig needs to define a
symbol using "option env=" syntax.  It is tedious to add a symbol entry
for each environment variable given that we need to define much more
such as 'CC', 'AS', 'srctree' etc. to evaluate the compiler capability
in Kconfig.

Adding '$' for symbol references is grammatically inconsistent.
Looking at the code, the symbols prefixed with 'S' are expanded by:
 - conf_expand_value()
   This is used to expand 'arch/$ARCH/defconfig' and 'defconfig_list'
 - sym_expand_string_value()
   This is used to expand strings in 'source' and 'mainmenu'

All of them are fixed values independent of user configuration.  So,
they can be changed into the direct expansion instead of symbols.

This change makes the code much cleaner.  The bounce symbols 'SRCARCH',
'ARCH', 'SUBARCH', 'KERNELVERSION' are gone.

sym_init() hard-coding 'UNAME_RELEASE' is also gone.  'UNAME_RELEASE'
should be replaced with an environment variable.

ARCH_DEFCONFIG is a normal symbol, so it should be simply referenced
without '$' prefix.

The new syntax is addicted by Make.  The variable reference needs
parentheses, like $(FOO), but you can omit them for single-letter
variables, like $F.  Yet, in Makefiles, people tend to use the
parenthetical form for consistency / clarification.

At this moment, only the environment variable is supported, but I will
extend the concept of 'variable' later on.

The variables are expanded in the lexer so we can simplify the token
handling on the parser side.

For example, the following code works.

[Example code]

  config MY_TOOLCHAIN_LIST
          string
          default "My tools: CC=$(CC), AS=$(AS), CPP=$(CPP)"

[Result]

  $ make -s alldefconfig &amp;&amp; tail -n 1 .config
  CONFIG_MY_TOOLCHAIN_LIST="My tools: CC=gcc, AS=as, CPP=gcc -E"

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
</entry>
<entry>
<title>kconfig: make unmet dependency warnings readable</title>
<updated>2018-03-25T17:04:06+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2018-03-13T09:56:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f8f69dc0b4e070d4a4d39889a85424913cc922d5'/>
<id>urn:sha1:f8f69dc0b4e070d4a4d39889a85424913cc922d5</id>
<content type='text'>
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 &amp;&amp; DEP2
          select E

  config D
          def_bool n
          select E

  config E
          bool
          depends on DEP1 &amp;&amp; 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 &amp;&amp; B &amp;&amp; D) selects E which has unmet direct
  dependencies (DEP1 &amp;&amp; DEP2)

Here, I see some points to be improved.

First, '(A || B || D)' would make more sense than '(A &amp;&amp; B &amp;&amp; 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 &amp;&amp; AHCI_MTK &amp;&amp; STMMAC_PLATFORM &amp;&amp;
 DWMAC_IPQ806X &amp;&amp; DWMAC_LPC18XX &amp;&amp; DWMAC_OXNAS &amp;&amp; DWMAC_ROCKCHIP &amp;&amp;
 DWMAC_SOCFPGA &amp;&amp; DWMAC_STI &amp;&amp; TI_CPSW &amp;&amp; PINCTRL_GEMINI &amp;&amp;
 PINCTRL_OXNAS &amp;&amp; PINCTRL_ROCKCHIP &amp;&amp; PINCTRL_DOVE &amp;&amp;
 PINCTRL_ARMADA_37XX &amp;&amp; PINCTRL_STM32 &amp;&amp; S3C2410_WATCHDOG &amp;&amp;
 VIDEO_OMAP3 &amp;&amp; VIDEO_S5P_FIMC &amp;&amp; USB_XHCI_MTK &amp;&amp; RTC_DRV_AT91SAM9 &amp;&amp;
 LPC18XX_DMAMUX &amp;&amp; VIDEO_OMAP4 &amp;&amp; COMMON_CLK_GEMINI &amp;&amp;
 COMMON_CLK_ASPEED &amp;&amp; COMMON_CLK_NXP &amp;&amp; COMMON_CLK_OXNAS &amp;&amp;
 COMMON_CLK_BOSTON &amp;&amp; QCOM_ADSP_PIL &amp;&amp; QCOM_Q6V5_PIL &amp;&amp; QCOM_GSBI &amp;&amp;
 ATMEL_EBI &amp;&amp; ST_IRQCHIP &amp;&amp; RESET_IMX7 &amp;&amp; PHY_HI6220_USB &amp;&amp;
 PHY_RALINK_USB &amp;&amp; PHY_ROCKCHIP_PCIE &amp;&amp; PHY_DA8XX_USB) selects
 MFD_SYSCON which has unmet direct dependencies (HAS_IOMEM)
warning: (PINCTRL_AT91 &amp;&amp; PINCTRL_AT91PIO4 &amp;&amp; PINCTRL_OXNAS &amp;&amp;
 PINCTRL_PISTACHIO &amp;&amp; PINCTRL_PIC32 &amp;&amp; PINCTRL_MESON &amp;&amp;
 PINCTRL_NOMADIK &amp;&amp; PINCTRL_MTK &amp;&amp; PINCTRL_MT7622 &amp;&amp; GPIO_TB10X)
 selects OF_GPIO which has unmet direct dependencies (GPIOLIB &amp;&amp; OF &amp;&amp;
 HAS_IOMEM)
warning: (FAULT_INJECTION_STACKTRACE_FILTER &amp;&amp; LATENCYTOP &amp;&amp; LOCKDEP)
 selects FRAME_POINTER which has unmet direct dependencies
 (DEBUG_KERNEL &amp;&amp; (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] &amp;&amp; PINCTRL [=y] &amp;&amp; (ARCH_STM32 ||
 COMPILE_TEST [=y]) &amp;&amp; OF [=y]
  - RTC_DRV_AT91SAM9 [=y] &amp;&amp; RTC_CLASS [=y] &amp;&amp; (ARCH_AT91 ||
 COMPILE_TEST [=y])
  - RESET_IMX7 [=y] &amp;&amp; RESET_CONTROLLER [=y]
  - PHY_HI6220_USB [=y] &amp;&amp; (ARCH_HISI &amp;&amp; ARM64 ||
 COMPILE_TEST [=y])
  - PHY_RALINK_USB [=y] &amp;&amp; (RALINK || COMPILE_TEST [=y])
  - PHY_ROCKCHIP_PCIE [=y] &amp;&amp; (ARCH_ROCKCHIP &amp;&amp; OF [=y] ||
 COMPILE_TEST [=y])

WARNING: unmet direct dependencies detected for OF_GPIO
  Depends on [n]: GPIOLIB [=y] &amp;&amp; OF [=y] &amp;&amp; HAS_IOMEM [=n]
  Selected by [y]:
  - PINCTRL_MTK [=y] &amp;&amp; PINCTRL [=y] &amp;&amp; (ARCH_MEDIATEK ||
 COMPILE_TEST [=y]) &amp;&amp; OF [=y]
  - PINCTRL_MT7622 [=y] &amp;&amp; PINCTRL [=y] &amp;&amp; (ARCH_MEDIATEK ||
 COMPILE_TEST [=y]) &amp;&amp; OF [=y] &amp;&amp; (ARM64 || COMPILE_TEST [=y])

WARNING: unmet direct dependencies detected for FRAME_POINTER
  Depends on [n]: DEBUG_KERNEL [=y] &amp;&amp; (CRIS || M68K || FRV || UML ||
 SUPERH || BLACKFIN || MN10300 || METAG) || ARCH_WANT_FRAME_POINTERS [=n]
  Selected by [y]:
  - LATENCYTOP [=y] &amp;&amp; DEBUG_KERNEL [=y] &amp;&amp; STACKTRACE_SUPPORT [=y] &amp;&amp;
 PROC_FS [=y] &amp;&amp; !MIPS &amp;&amp; !PPC &amp;&amp; !S390 &amp;&amp; !MICROBLAZE &amp;&amp; !ARM_UNWIND &amp;&amp;
 !ARC &amp;&amp; !X86

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Reviewed-by: Petr Vorel &lt;petr.vorel@gmail.com&gt;
</content>
</entry>
<entry>
<title>kconfig: warn unmet direct dependency of tristate symbols selected by y</title>
<updated>2018-03-25T17:04:05+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2018-03-13T09:56:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f622f8279581626170154d77d67e67bcb227ca2f'/>
<id>urn:sha1:f622f8279581626170154d77d67e67bcb227ca2f</id>
<content type='text'>
Commit 246cf9c26bf1 ("kbuild: Warn on selecting symbols with unmet
direct dependencies") forcibly promoted -&gt;dir_dep.tri to yes from mod.
So, the unmet direct dependencies of tristate symbols are not reported.

[Test Case]

  config MODULES
          def_bool y
          option modules

  config A
          def_bool y
          select B

  config B
          tristate "B"
          depends on m

This causes unmet dependency because 'B' is forced 'y' ignoring
'depends on m'.  This should be warned.

On the other hand, the following case ('B' is bool) should not be
warned, so 'depends on m' for bool symbols should be naturally treated
as 'depends on y'.

[Test Case2 (not unmet dependency)]

  config MODULES
          def_bool y
          option modules

  config A
          def_bool y
          select B

  config B
          bool "B"
          depends on m

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
</content>
</entry>
</feed>
