<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/scripts/kconfig, branch v4.2-rc2</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild</title>
<updated>2015-07-02T21:53:01+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2015-07-02T21:53:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a95cb3cd55c208372ca68d5e8a9923611fed7235'/>
<id>a95cb3cd55c208372ca68d5e8a9923611fed7235</id>
<content type='text'>
Pull kconfig updates from Michal Marek:

 - kconfig conditions can use usual less/greater than comparisons

 - kconfig warns about stray characters in Kconfig files

 - bogus expression simplification removed

 - some minor fixes

* 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  kconfig: re-generate *.c_shipped files after previous change
  kconfig: allow use of relations other than (in)equality
  kconfig: don't silently ignore unhandled characters
  kconfig: Wrap long "make help" text lines
  scripts/kconfig/Makefile: Cosmetic fixes
  scripts/kconfig/Makefile: Fix spelling of Qt
  Kconfig: Remove bad inference rules expr_eliminate_dups2()
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull kconfig updates from Michal Marek:

 - kconfig conditions can use usual less/greater than comparisons

 - kconfig warns about stray characters in Kconfig files

 - bogus expression simplification removed

 - some minor fixes

* 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  kconfig: re-generate *.c_shipped files after previous change
  kconfig: allow use of relations other than (in)equality
  kconfig: don't silently ignore unhandled characters
  kconfig: Wrap long "make help" text lines
  scripts/kconfig/Makefile: Cosmetic fixes
  scripts/kconfig/Makefile: Fix spelling of Qt
  Kconfig: Remove bad inference rules expr_eliminate_dups2()
</pre>
</div>
</content>
</entry>
<entry>
<title>kconfig: add xenconfig defconfig helper</title>
<updated>2015-06-16T10:04:29+00:00</updated>
<author>
<name>Luis R. Rodriguez</name>
<email>mcgrof@suse.com</email>
</author>
<published>2015-05-20T18:53:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=6c6685055a285de53f18fbf6611687291b57ccd6'/>
<id>6c6685055a285de53f18fbf6611687291b57ccd6</id>
<content type='text'>
This lets you build a kernel which can support xen dom0
or xen guests on i386, x86-64 and arm64 by just using:

   make xenconfig

You can start from an allnoconfig and then switch to xenconfig.
This also splits out the options which are available currently
to be built with x86 and 'make ARCH=arm64' under a shared config.

Technically xen supports a dom0 kernel and also a guest
kernel configuration but upon review with the xen team
since we don't have many dom0 options its best to just
combine these two into one.

A few generic notes: we enable both of these:

CONFIG_INET=y
CONFIG_BINFMT_ELF=y

although technically not required given you likely will
end up with a pretty useless system otherwise.

A few architectural differences worth noting:

$ make allnoconfig; make xenconfig &gt; /dev/null ; \
	grep XEN .config &gt; 64-bit-config
$ make ARCH=i386 allnoconfig; make ARCH=i386 xenconfig &gt; /dev/null; \
	grep XEN .config &gt; 32-bit-config
$ make ARCH=arm64 allnoconfig; make ARCH=arm64 xenconfig &gt; /dev/null; \
	grep XEN .config &gt; arm64-config

Since the options are already split up with a generic config and
architecture specific configs you anything on the x86 configs
are known to only work right now on x86. For instance arm64 doesn't
support MEMORY_HOTPLUG yet as such although we try to enabe it
generically arm64 doesn't have it yet, so we leave the xen
specific kconfig option XEN_BALLOON_MEMORY_HOTPLUG on x86's config
file to set expecations correctly.

Then on x86 we have differences between i386 and x86-64. The difference
between 64-bit-config and 32-bit-config is you don't get XEN_MCE_LOG as
this is only supported on 64-bit. You also do not get on i386
XEN_BALLOON_MEMORY_HOTPLUG, there does not seem to be any technical
reasons to not allow this but I gave up after a few attempts.

Cc: Josh Triplett &lt;josh@joshtriplett.org&gt;
Cc: Borislav Petkov &lt;bp@suse.de&gt;
Cc: Pekka Enberg &lt;penberg@kernel.org&gt;
Cc: David Rientjes &lt;rientjes@google.com&gt;
Cc: Michal Marek &lt;mmarek@suse.cz&gt;
Cc: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Cc: penberg@kernel.org
Cc: levinsasha928@gmail.com
Cc: mtosatti@redhat.com
Cc: fengguang.wu@intel.com
Cc: David Vrabel &lt;david.vrabel@citrix.com&gt;
Cc: Ian Campbell &lt;Ian.Campbell@citrix.com&gt;
Cc: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Cc: xen-devel@lists.xenproject.org
Acked-by: Stefano Stabellini &lt;stefano.stabellini@eu.citrix.com&gt;
Acked-by: Julien Grall &lt;julien.grall@linaro.org&gt;
Acked-by: Michal Marek &lt;mmarek@suse.cz&gt;
Acked-by: David Rientjes &lt;rientjes@google.com&gt;
Reviewed-by: Josh Triplett &lt;josh@joshtriplett.org&gt;
Signed-off-by: Luis R. Rodriguez &lt;mcgrof@suse.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This lets you build a kernel which can support xen dom0
or xen guests on i386, x86-64 and arm64 by just using:

   make xenconfig

You can start from an allnoconfig and then switch to xenconfig.
This also splits out the options which are available currently
to be built with x86 and 'make ARCH=arm64' under a shared config.

Technically xen supports a dom0 kernel and also a guest
kernel configuration but upon review with the xen team
since we don't have many dom0 options its best to just
combine these two into one.

A few generic notes: we enable both of these:

CONFIG_INET=y
CONFIG_BINFMT_ELF=y

although technically not required given you likely will
end up with a pretty useless system otherwise.

A few architectural differences worth noting:

$ make allnoconfig; make xenconfig &gt; /dev/null ; \
	grep XEN .config &gt; 64-bit-config
$ make ARCH=i386 allnoconfig; make ARCH=i386 xenconfig &gt; /dev/null; \
	grep XEN .config &gt; 32-bit-config
$ make ARCH=arm64 allnoconfig; make ARCH=arm64 xenconfig &gt; /dev/null; \
	grep XEN .config &gt; arm64-config

Since the options are already split up with a generic config and
architecture specific configs you anything on the x86 configs
are known to only work right now on x86. For instance arm64 doesn't
support MEMORY_HOTPLUG yet as such although we try to enabe it
generically arm64 doesn't have it yet, so we leave the xen
specific kconfig option XEN_BALLOON_MEMORY_HOTPLUG on x86's config
file to set expecations correctly.

Then on x86 we have differences between i386 and x86-64. The difference
between 64-bit-config and 32-bit-config is you don't get XEN_MCE_LOG as
this is only supported on 64-bit. You also do not get on i386
XEN_BALLOON_MEMORY_HOTPLUG, there does not seem to be any technical
reasons to not allow this but I gave up after a few attempts.

Cc: Josh Triplett &lt;josh@joshtriplett.org&gt;
Cc: Borislav Petkov &lt;bp@suse.de&gt;
Cc: Pekka Enberg &lt;penberg@kernel.org&gt;
Cc: David Rientjes &lt;rientjes@google.com&gt;
Cc: Michal Marek &lt;mmarek@suse.cz&gt;
Cc: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Cc: penberg@kernel.org
Cc: levinsasha928@gmail.com
Cc: mtosatti@redhat.com
Cc: fengguang.wu@intel.com
Cc: David Vrabel &lt;david.vrabel@citrix.com&gt;
Cc: Ian Campbell &lt;Ian.Campbell@citrix.com&gt;
Cc: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Cc: xen-devel@lists.xenproject.org
Acked-by: Stefano Stabellini &lt;stefano.stabellini@eu.citrix.com&gt;
Acked-by: Julien Grall &lt;julien.grall@linaro.org&gt;
Acked-by: Michal Marek &lt;mmarek@suse.cz&gt;
Acked-by: David Rientjes &lt;rientjes@google.com&gt;
Reviewed-by: Josh Triplett &lt;josh@joshtriplett.org&gt;
Signed-off-by: Luis R. Rodriguez &lt;mcgrof@suse.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kconfig: clarify kvmconfig is for kvm</title>
<updated>2015-06-16T10:04:21+00:00</updated>
<author>
<name>Luis R. Rodriguez</name>
<email>mcgrof@suse.com</email>
</author>
<published>2015-05-20T18:53:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=9bcd776d299e8adb8ed37be0453472aa3cc2b7db'/>
<id>9bcd776d299e8adb8ed37be0453472aa3cc2b7db</id>
<content type='text'>
We'll be adding options for xen as well.

Cc: Josh Triplett &lt;josh@joshtriplett.org&gt;
Cc: Borislav Petkov &lt;bp@suse.de&gt;
Cc: Pekka Enberg &lt;penberg@kernel.org&gt;
Cc: David Rientjes &lt;rientjes@google.com&gt;
Cc: Michal Marek &lt;mmarek@suse.cz&gt;
Cc: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Cc: penberg@kernel.org
Cc: levinsasha928@gmail.com
Cc: mtosatti@redhat.com
Cc: fengguang.wu@intel.com
Cc: David Vrabel &lt;david.vrabel@citrix.com&gt;
Cc: Ian Campbell &lt;Ian.Campbell@citrix.com&gt;
Cc: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Cc: xen-devel@lists.xenproject.org
Reviewed-by: Josh Triplett &lt;josh@joshtriplett.org&gt;
Acked-by: David Rientjes &lt;rientjes@google.com&gt;
Acked-by: Borislav Petkov &lt;bp@suse.de&gt;
Acked-by: Michal Marek &lt;mmarek@suse.cz&gt;
Signed-off-by: Luis R. Rodriguez &lt;mcgrof@suse.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We'll be adding options for xen as well.

Cc: Josh Triplett &lt;josh@joshtriplett.org&gt;
Cc: Borislav Petkov &lt;bp@suse.de&gt;
Cc: Pekka Enberg &lt;penberg@kernel.org&gt;
Cc: David Rientjes &lt;rientjes@google.com&gt;
Cc: Michal Marek &lt;mmarek@suse.cz&gt;
Cc: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Cc: penberg@kernel.org
Cc: levinsasha928@gmail.com
Cc: mtosatti@redhat.com
Cc: fengguang.wu@intel.com
Cc: David Vrabel &lt;david.vrabel@citrix.com&gt;
Cc: Ian Campbell &lt;Ian.Campbell@citrix.com&gt;
Cc: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Cc: xen-devel@lists.xenproject.org
Reviewed-by: Josh Triplett &lt;josh@joshtriplett.org&gt;
Acked-by: David Rientjes &lt;rientjes@google.com&gt;
Acked-by: Borislav Petkov &lt;bp@suse.de&gt;
Acked-by: Michal Marek &lt;mmarek@suse.cz&gt;
Signed-off-by: Luis R. Rodriguez &lt;mcgrof@suse.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kconfig: re-generate *.c_shipped files after previous change</title>
<updated>2015-06-15T12:05:58+00:00</updated>
<author>
<name>Jan Beulich</name>
<email>JBeulich@suse.com</email>
</author>
<published>2015-06-15T12:00:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=4a47f1eb35c5933ef32b2b99ef20f8fe4a251429'/>
<id>4a47f1eb35c5933ef32b2b99ef20f8fe4a251429</id>
<content type='text'>
Signed-off-by: Jan Beulich &lt;jbeulich@suse.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Jan Beulich &lt;jbeulich@suse.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kconfig: allow use of relations other than (in)equality</title>
<updated>2015-06-15T12:05:58+00:00</updated>
<author>
<name>Jan Beulich</name>
<email>JBeulich@suse.com</email>
</author>
<published>2015-06-15T12:00:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=31847b67bec0e989961118520406a63fdeac7246'/>
<id>31847b67bec0e989961118520406a63fdeac7246</id>
<content type='text'>
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 &gt; 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: Jan Beulich &lt;jbeulich@suse.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &gt; 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: Jan Beulich &lt;jbeulich@suse.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kconfig: don't silently ignore unhandled characters</title>
<updated>2015-06-11T12:25:56+00:00</updated>
<author>
<name>Jan Beulich</name>
<email>JBeulich@suse.com</email>
</author>
<published>2015-01-20T12:52:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=2e0d737fc76f8d31e2265b3f0392749f75efd735'/>
<id>2e0d737fc76f8d31e2265b3f0392749f75efd735</id>
<content type='text'>
At the very least we should tell people that what they wrote is not
what the utility understands.

Signed-off-by: Jan Beulich &lt;jbeulich@suse.com&gt;
Acked-by: Paul Bolle &lt;pebolle@tiscali.nl&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
At the very least we should tell people that what they wrote is not
what the utility understands.

Signed-off-by: Jan Beulich &lt;jbeulich@suse.com&gt;
Acked-by: Paul Bolle &lt;pebolle@tiscali.nl&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kconfig: Wrap long "make help" text lines</title>
<updated>2015-06-04T14:41:47+00:00</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2015-05-26T11:39:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=fa75a727c01963088299a7fa691e71ed90018a7d'/>
<id>fa75a727c01963088299a7fa691e71ed90018a7d</id>
<content type='text'>
Some "make help" text lines extend beyond 80 characters. Wrap them at 79
characters.

Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some "make help" text lines extend beyond 80 characters. Wrap them at 79
characters.

Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scripts/kconfig/Makefile: Cosmetic fixes</title>
<updated>2015-06-03T08:56:12+00:00</updated>
<author>
<name>Diego Viola</name>
<email>diego.viola@gmail.com</email>
</author>
<published>2015-05-31T17:35:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=39c3f1ba5ee3b937c43747f60dfa869d9776a4ac'/>
<id>39c3f1ba5ee3b937c43747f60dfa869d9776a4ac</id>
<content type='text'>
Signed-off-by: Diego Viola &lt;diego.viola@gmail.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Diego Viola &lt;diego.viola@gmail.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scripts/kconfig/Makefile: Fix spelling of Qt</title>
<updated>2015-05-28T08:27:02+00:00</updated>
<author>
<name>Diego Viola</name>
<email>diego.viola@gmail.com</email>
</author>
<published>2015-04-06T09:27:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=092373c2b8cb67b757ec59f3e6251b45ef333b38'/>
<id>092373c2b8cb67b757ec59f3e6251b45ef333b38</id>
<content type='text'>
Signed-off-by: Diego Viola &lt;diego.viola@gmail.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Diego Viola &lt;diego.viola@gmail.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Kconfig: Remove bad inference rules expr_eliminate_dups2()</title>
<updated>2015-05-25T08:04:12+00:00</updated>
<author>
<name>Martin Walch</name>
<email>walch.martin@web.de</email>
</author>
<published>2015-05-22T11:41:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e911503085ae8a6bb826588076f66df05890253c'/>
<id>e911503085ae8a6bb826588076f66df05890253c</id>
<content type='text'>
expr_eliminate_dups2() in scripts/kconfig/expr.c applies two invalid
inference rules:

(FOO || BAR) &amp;&amp; (!FOO &amp;&amp; !BAR) -&gt; n
(FOO &amp;&amp; BAR) || (!FOO || !BAR) -&gt; y

They would be correct in propositional logic, but this is a three-valued
logic, and here it is wrong in that it changes semantics. It becomes
immediately visible when assigning the value 1 to both, FOO and BAR:

(FOO || BAR) &amp;&amp; (!FOO &amp;&amp; !BAR)
-&gt; min(max(1, 1), min(2-1, 2-1)) = min(1, 1) = 1

while n evaluates to 0 and

(FOO &amp;&amp; BAR) || (!FOO || !BAR)
-&gt; max(min(1, 1), max(2-1, 2-1)) = max(1, 1) = 1

with y evaluating to 2.

Fix it by removing expr_eliminate_dups2() and the functions that have no
use anywhere else: expr_extract_eq_and(), expr_extract_eq_or(),
and expr_extract_eq() from scripts/kconfig/expr.c

Currently the bug is not triggered in mainline, so this patch does not
modify the configuration space there. To observe the bug consider this
example:

config MODULES
        def_bool y
        option modules

config FOO
        def_tristate m

config BAR
        def_tristate m

config TEST1
        def_tristate y
        depends on (FOO || BAR) &amp;&amp; (!FOO &amp;&amp; !BAR)

if TEST1 = n
comment "TEST1 broken"
endif

config TEST2
        def_tristate y
        depends on (FOO &amp;&amp; BAR) || (!FOO || !BAR)

if TEST2 = y
comment "TEST2 broken"
endif

config TEST3
        def_tristate y
        depends on m &amp;&amp; !m

if TEST3 = n
comment "TEST3 broken"
endif

TEST1, TEST2 and TEST3 should all evaluate to m, but without the patch,
none of them does. It is probably not obvious that TEST3 is the same bug,
but it becomes clear when considering what happens internally to the
expression
m &amp;&amp; !m":
First it expands to
(m &amp;&amp; MODULES) &amp;&amp; !(m &amp;&amp; MODULES),
then it is transformed into
(m &amp;&amp; MODULES) &amp;&amp; (!m || !MODULES),
and finally due to the bug it is replaced with n.

As a side effect, this patch reduces code size in expr.c by roughly 10%
and slightly improves startup time for all configuration frontends.

Signed-off-by: Martin Walch &lt;walch.martin@web.de&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
expr_eliminate_dups2() in scripts/kconfig/expr.c applies two invalid
inference rules:

(FOO || BAR) &amp;&amp; (!FOO &amp;&amp; !BAR) -&gt; n
(FOO &amp;&amp; BAR) || (!FOO || !BAR) -&gt; y

They would be correct in propositional logic, but this is a three-valued
logic, and here it is wrong in that it changes semantics. It becomes
immediately visible when assigning the value 1 to both, FOO and BAR:

(FOO || BAR) &amp;&amp; (!FOO &amp;&amp; !BAR)
-&gt; min(max(1, 1), min(2-1, 2-1)) = min(1, 1) = 1

while n evaluates to 0 and

(FOO &amp;&amp; BAR) || (!FOO || !BAR)
-&gt; max(min(1, 1), max(2-1, 2-1)) = max(1, 1) = 1

with y evaluating to 2.

Fix it by removing expr_eliminate_dups2() and the functions that have no
use anywhere else: expr_extract_eq_and(), expr_extract_eq_or(),
and expr_extract_eq() from scripts/kconfig/expr.c

Currently the bug is not triggered in mainline, so this patch does not
modify the configuration space there. To observe the bug consider this
example:

config MODULES
        def_bool y
        option modules

config FOO
        def_tristate m

config BAR
        def_tristate m

config TEST1
        def_tristate y
        depends on (FOO || BAR) &amp;&amp; (!FOO &amp;&amp; !BAR)

if TEST1 = n
comment "TEST1 broken"
endif

config TEST2
        def_tristate y
        depends on (FOO &amp;&amp; BAR) || (!FOO || !BAR)

if TEST2 = y
comment "TEST2 broken"
endif

config TEST3
        def_tristate y
        depends on m &amp;&amp; !m

if TEST3 = n
comment "TEST3 broken"
endif

TEST1, TEST2 and TEST3 should all evaluate to m, but without the patch,
none of them does. It is probably not obvious that TEST3 is the same bug,
but it becomes clear when considering what happens internally to the
expression
m &amp;&amp; !m":
First it expands to
(m &amp;&amp; MODULES) &amp;&amp; !(m &amp;&amp; MODULES),
then it is transformed into
(m &amp;&amp; MODULES) &amp;&amp; (!m || !MODULES),
and finally due to the bug it is replaced with n.

As a side effect, this patch reduces code size in expr.c by roughly 10%
and slightly improves startup time for all configuration frontends.

Signed-off-by: Martin Walch &lt;walch.martin@web.de&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</pre>
</div>
</content>
</entry>
</feed>
