<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/scripts/kconfig, branch v4.17</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>kconfig: extend output of 'listnewconfig'</title>
<updated>2018-04-13T14:23:11+00:00</updated>
<author>
<name>Don Zickus</name>
<email>dzickus@redhat.com</email>
</author>
<published>2018-04-11T19:15:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=17baab68d337a0bf4654091e2b4cd67c3fdb44d8'/>
<id>17baab68d337a0bf4654091e2b4cd67c3fdb44d8</id>
<content type='text'>
We at Red Hat/Fedora have generally tried to have a per file breakdown of
every config option we set.  This makes it easy for us to add new options
when they are exposed and keep a changelog of why they were set.

A Fedora example is here:
  https://src.fedoraproject.org/cgit/rpms/kernel.git/tree/configs/fedora/generic

Using various merge scripts, we build up a config file and run it through
'make listnewconfig' and 'make oldnoconfig'.   The idea is to print out new
config options that haven't been manually set and use the default until
a patch is posted to set it properly.

To speed things up, it would be nice to make it easier to generate a
patch to post the default setting.  The output of 'make listnewconfig'
has two issues that limit us:

- it doesn't provide the default value
- it doesn't provide the new 'choice' options that get flagged in
  'oldconfig'

This patch extends 'listnewconfig' to address the above two issues.

This allows us to run a script

make listnewconfig | rhconfig-tool -o patches; git send-email patches/

The output of 'make listnewconfig':

CONFIG_NET_EMATCH_IPT
CONFIG_IPVLAN
CONFIG_ICE
CONFIG_NET_VENDOR_NI
CONFIG_IEEE802154_MCR20A
CONFIG_IR_IMON_DECODER
CONFIG_IR_IMON_RAW

The new output of 'make listnewconfig':

CONFIG_KERNEL_XZ=n
CONFIG_KERNEL_LZO=n
CONFIG_NET_EMATCH_IPT=n
CONFIG_IPVLAN=n
CONFIG_ICE=n
CONFIG_NET_VENDOR_NI=y
CONFIG_IEEE802154_MCR20A=n
CONFIG_IR_IMON_DECODER=n
CONFIG_IR_IMON_RAW=n

Signed-off-by: Don Zickus &lt;dzickus@redhat.com&gt;
Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We at Red Hat/Fedora have generally tried to have a per file breakdown of
every config option we set.  This makes it easy for us to add new options
when they are exposed and keep a changelog of why they were set.

A Fedora example is here:
  https://src.fedoraproject.org/cgit/rpms/kernel.git/tree/configs/fedora/generic

Using various merge scripts, we build up a config file and run it through
'make listnewconfig' and 'make oldnoconfig'.   The idea is to print out new
config options that haven't been manually set and use the default until
a patch is posted to set it properly.

To speed things up, it would be nice to make it easier to generate a
patch to post the default setting.  The output of 'make listnewconfig'
has two issues that limit us:

- it doesn't provide the default value
- it doesn't provide the new 'choice' options that get flagged in
  'oldconfig'

This patch extends 'listnewconfig' to address the above two issues.

This allows us to run a script

make listnewconfig | rhconfig-tool -o patches; git send-email patches/

The output of 'make listnewconfig':

CONFIG_NET_EMATCH_IPT
CONFIG_IPVLAN
CONFIG_ICE
CONFIG_NET_VENDOR_NI
CONFIG_IEEE802154_MCR20A
CONFIG_IR_IMON_DECODER
CONFIG_IR_IMON_RAW

The new output of 'make listnewconfig':

CONFIG_KERNEL_XZ=n
CONFIG_KERNEL_LZO=n
CONFIG_NET_EMATCH_IPT=n
CONFIG_IPVLAN=n
CONFIG_ICE=n
CONFIG_NET_VENDOR_NI=y
CONFIG_IEEE802154_MCR20A=n
CONFIG_IR_IMON_DECODER=n
CONFIG_IR_IMON_RAW=n

Signed-off-by: Don Zickus &lt;dzickus@redhat.com&gt;
Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kbuild: add %.lex.c and %.tab.[ch] to 'targets' automatically</title>
<updated>2018-04-07T10:04:02+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2018-03-23T13:04:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b23d1a241f4eb44ae55785c9b65274717c8e2c1e'/>
<id>b23d1a241f4eb44ae55785c9b65274717c8e2c1e</id>
<content type='text'>
Files generated by if_changed* must be added to 'targets' to include
*.cmd files.  Otherwise, they would be regenerated every time.

The build system automatically adds objects to 'targets' where
appropriate, such as obj-y, extra-y, etc. but does nothing for
intermediate files.  So, each Makefile needs to add them by itself.

There are some common cases where objects are generated by chained
rules.  Lexers and parsers are compiled like follows:

   %.lex.o &lt;- %.lex.c &lt;- %.l
   %.tab.o &lt;- %.tab.c &lt;- %.y

They are common patterns, so it is reasonable to take care of them
in the core Makefile instead of requiring each Makefile to do so.

At this moment, you cannot delete 'target += zconf.lex.c' in the
Kconfig Makefile because zconf.lex.c is included from zconf.tab.c
instead of being compiled separately.  It should be deleted after
Kconfig is more refactored.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Acked-by: Frank Rowand &lt;frowand.list@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Files generated by if_changed* must be added to 'targets' to include
*.cmd files.  Otherwise, they would be regenerated every time.

The build system automatically adds objects to 'targets' where
appropriate, such as obj-y, extra-y, etc. but does nothing for
intermediate files.  So, each Makefile needs to add them by itself.

There are some common cases where objects are generated by chained
rules.  Lexers and parsers are compiled like follows:

   %.lex.o &lt;- %.lex.c &lt;- %.l
   %.tab.o &lt;- %.tab.c &lt;- %.y

They are common patterns, so it is reasonable to take care of them
in the core Makefile instead of requiring each Makefile to do so.

At this moment, you cannot delete 'target += zconf.lex.c' in the
Kconfig Makefile because zconf.lex.c is included from zconf.tab.c
instead of being compiled separately.  It should be deleted after
Kconfig is more refactored.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Acked-by: Frank Rowand &lt;frowand.list@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kbuild: clean up *.lex.c and *.tab.[ch] patterns from top-level Makefile</title>
<updated>2018-04-07T10:04:02+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2018-03-23T13:04:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=9a8dfb394c046742b2ac7444ba42272e11e9989d'/>
<id>9a8dfb394c046742b2ac7444ba42272e11e9989d</id>
<content type='text'>
Files suffixed by .lex.c, .tab.[ch] are generated lexers, parsers,
respectively.  Clean them up globally from the top Makefile.

Some of the final host programs those lexer/parser are linked into
are necessary for building external modules, but the intermediates
are unneeded.  They can be cleaned away by 'make clean' instead of
'make mrproper'.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Acked-by: Frank Rowand &lt;frowand.list@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Files suffixed by .lex.c, .tab.[ch] are generated lexers, parsers,
respectively.  Clean them up globally from the top Makefile.

Some of the final host programs those lexer/parser are linked into
are necessary for building external modules, but the intermediates
are unneeded.  They can be cleaned away by 'make clean' instead of
'make mrproper'.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Acked-by: Frank Rowand &lt;frowand.list@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>.gitignore: move *.lex.c *.tab.[ch] patterns to the top-level .gitignore</title>
<updated>2018-04-07T10:04:02+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2018-03-23T13:04:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=598893002745690e57692ca5bf6fb9ff04604a1b'/>
<id>598893002745690e57692ca5bf6fb9ff04604a1b</id>
<content type='text'>
These patterns are common to host programs that require lexer and parser.
Move them to the top .gitignore.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Acked-by: Frank Rowand &lt;frowand.list@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These patterns are common to host programs that require lexer and parser.
Move them to the top .gitignore.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Acked-by: Frank Rowand &lt;frowand.list@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'kconfig-v4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild</title>
<updated>2018-04-03T23:28:01+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2018-04-03T23:28:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=147a89bc71e7db40f011454a40add7ff2d10f8d8'/>
<id>147a89bc71e7db40f011454a40add7ff2d10f8d8</id>
<content type='text'>
Pull Kconfig updates from Masahiro Yamada:

 - improve checkpatch for more precise Kconfig code checking

 - clarify effective selects by grouping reverse dependencies in help

 - do not write out '# CONFIG_FOO is not set' from invisible symbols

 - make oldconfig as silent as it should be

 - rename 'silentoldconfig' to 'syncconfig'

 - add unit-test framework and several test cases

 - warn unmet dependency of tristate symbols

 - make unmet dependency warnings readable, removing false positives

 - improve recursive include detection

 - use yylineno to simplify the line number tracking

 - misc cleanups

* tag 'kconfig-v4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (30 commits)
  kconfig: use yylineno option instead of manual lineno increments
  kconfig: detect recursive inclusion earlier
  kconfig: remove duplicated file name and lineno of recursive inclusion
  kconfig: do not include both curses.h and ncurses.h for nconfig
  kconfig: make unmet dependency warnings readable
  kconfig: warn unmet direct dependency of tristate symbols selected by y
  kconfig: tests: test if recursive inclusion is detected
  kconfig: tests: test if recursive dependencies are detected
  kconfig: tests: test randconfig for choice in choice
  kconfig: tests: test defconfig when two choices interact
  kconfig: tests: check visibility of tristate choice values in y choice
  kconfig: tests: check unneeded "is not set" with unmet dependency
  kconfig: tests: test if new symbols in choice are asked
  kconfig: tests: test automatic submenu creation
  kconfig: tests: add basic choice tests
  kconfig: tests: add framework for Kconfig unit testing
  kbuild: add PYTHON2 and PYTHON3 variables
  kconfig: remove redundant streamline_config.pl prerequisite
  kconfig: rename silentoldconfig to syncconfig
  kconfig: invoke oldconfig instead of silentoldconfig from local*config
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull Kconfig updates from Masahiro Yamada:

 - improve checkpatch for more precise Kconfig code checking

 - clarify effective selects by grouping reverse dependencies in help

 - do not write out '# CONFIG_FOO is not set' from invisible symbols

 - make oldconfig as silent as it should be

 - rename 'silentoldconfig' to 'syncconfig'

 - add unit-test framework and several test cases

 - warn unmet dependency of tristate symbols

 - make unmet dependency warnings readable, removing false positives

 - improve recursive include detection

 - use yylineno to simplify the line number tracking

 - misc cleanups

* tag 'kconfig-v4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (30 commits)
  kconfig: use yylineno option instead of manual lineno increments
  kconfig: detect recursive inclusion earlier
  kconfig: remove duplicated file name and lineno of recursive inclusion
  kconfig: do not include both curses.h and ncurses.h for nconfig
  kconfig: make unmet dependency warnings readable
  kconfig: warn unmet direct dependency of tristate symbols selected by y
  kconfig: tests: test if recursive inclusion is detected
  kconfig: tests: test if recursive dependencies are detected
  kconfig: tests: test randconfig for choice in choice
  kconfig: tests: test defconfig when two choices interact
  kconfig: tests: check visibility of tristate choice values in y choice
  kconfig: tests: check unneeded "is not set" with unmet dependency
  kconfig: tests: test if new symbols in choice are asked
  kconfig: tests: test automatic submenu creation
  kconfig: tests: add basic choice tests
  kconfig: tests: add framework for Kconfig unit testing
  kbuild: add PYTHON2 and PYTHON3 variables
  kconfig: remove redundant streamline_config.pl prerequisite
  kconfig: rename silentoldconfig to syncconfig
  kconfig: invoke oldconfig instead of silentoldconfig from local*config
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>kconfig: use yylineno option instead of manual lineno increments</title>
<updated>2018-03-25T17:04:07+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2018-03-22T17:00:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=18492685e479fd4d8e1dca836f57c11b6800f083'/>
<id>18492685e479fd4d8e1dca836f57c11b6800f083</id>
<content type='text'>
Tracking the line number by hand is error-prone since you need to
increment it in every \n matching pattern.

If '%option yylineno' is set, flex defines 'yylineno' to contain the
current line number and automatically updates it each time it reads a
\n character.  This is much more convenient although the lexer does
not initializes yylineno, so you need to set it to 1 each time you
start reading a new file, and restore it you go back to the previous
file.

I tested this with DEBUG_PARSE, and confirmed the same dump message
was produced.

I removed the perf-report option.  Otherwise, I see the following
message:
  %option yylineno entails a performance penalty ONLY on rules that
  can match newline characters

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Tracking the line number by hand is error-prone since you need to
increment it in every \n matching pattern.

If '%option yylineno' is set, flex defines 'yylineno' to contain the
current line number and automatically updates it each time it reads a
\n character.  This is much more convenient although the lexer does
not initializes yylineno, so you need to set it to 1 each time you
start reading a new file, and restore it you go back to the previous
file.

I tested this with DEBUG_PARSE, and confirmed the same dump message
was produced.

I removed the perf-report option.  Otherwise, I see the following
message:
  %option yylineno entails a performance penalty ONLY on rules that
  can match newline characters

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kconfig: detect recursive inclusion earlier</title>
<updated>2018-03-25T17:04:07+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2018-03-22T17:00:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=379a8eb8eb1a55344e1cf976fa589a12c68b60a7'/>
<id>379a8eb8eb1a55344e1cf976fa589a12c68b60a7</id>
<content type='text'>
Currently, the recursive inclusion is not detected when the offending
file is about to be included; it is detected the offending file is
about to include the *next* file.  This is because the detection loop
does not involve the file being included.

Do this check against the file that is about to be included so that
the recursive inclusion is detected before unneeded parsing happens.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, the recursive inclusion is not detected when the offending
file is about to be included; it is detected the offending file is
about to include the *next* file.  This is because the detection loop
does not involve the file being included.

Do this check against the file that is about to be included so that
the recursive inclusion is detected before unneeded parsing happens.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kconfig: remove duplicated file name and lineno of recursive inclusion</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-22T17:00:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=32a94b8b0c3e5ae575919850c5e49e936b704d45'/>
<id>32a94b8b0c3e5ae575919850c5e49e936b704d45</id>
<content type='text'>
As in the unit test, the error message for the recursive inclusion
looks like this:

  Kconfig.inc1:4: recursive inclusion detected. Inclusion path:
    current file : 'Kconfig.inc1'
    included from: 'Kconfig.inc3:1'
    included from: 'Kconfig.inc2:3'
    included from: 'Kconfig.inc1:4'

The 'Kconfig.inc1:4' is duplicated in the first and last lines.
Also, the single quotes do not help readability.

Change the message like follows:

  Recursive inclusion detected.
  Inclusion path:
    current file : Kconfig.inc1
    included from: Kconfig.inc3:1
    included from: Kconfig.inc2:3
    included from: Kconfig.inc1:4

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As in the unit test, the error message for the recursive inclusion
looks like this:

  Kconfig.inc1:4: recursive inclusion detected. Inclusion path:
    current file : 'Kconfig.inc1'
    included from: 'Kconfig.inc3:1'
    included from: 'Kconfig.inc2:3'
    included from: 'Kconfig.inc1:4'

The 'Kconfig.inc1:4' is duplicated in the first and last lines.
Also, the single quotes do not help readability.

Change the message like follows:

  Recursive inclusion detected.
  Inclusion path:
    current file : Kconfig.inc1
    included from: Kconfig.inc3:1
    included from: Kconfig.inc2:3
    included from: Kconfig.inc1:4

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kconfig: do not include both curses.h and ncurses.h for nconfig</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-15T06:25:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=26561514cc9defed09a043dfaedc900274b76ff2'/>
<id>26561514cc9defed09a043dfaedc900274b76ff2</id>
<content type='text'>
nconf.h includes &lt;curses.h&gt; and "ncurses.h", but it does not need to
include both.  Generally, it should fall back to curses.h only when
ncurses.h is not found.  But, looks like it has never happened;
these includes have been here for many years since commit 692d97c380c6
("kconfig: new configuration interface (nconfig)"), and nobody has
complained about hard-coding of ncurses.h .  Let's simply drop the
curses.h inclusion.

I replaced "ncurses.h" with &lt;ncurses.h&gt; since it is not a local file.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
nconf.h includes &lt;curses.h&gt; and "ncurses.h", but it does not need to
include both.  Generally, it should fall back to curses.h only when
ncurses.h is not found.  But, looks like it has never happened;
these includes have been here for many years since commit 692d97c380c6
("kconfig: new configuration interface (nconfig)"), and nobody has
complained about hard-coding of ncurses.h .  Let's simply drop the
curses.h inclusion.

I replaced "ncurses.h" with &lt;ncurses.h&gt; since it is not a local file.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
</pre>
</div>
</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.tavy.me/linux.git/commit/?id=f8f69dc0b4e070d4a4d39889a85424913cc922d5'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
</feed>
