<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/scripts/kconfig/expr.c, branch v4.11-rc3</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>kconfig: Fix copy&amp;paste error</title>
<updated>2015-10-20T17:13:14+00:00</updated>
<author>
<name>Michal Sojka</name>
<email>sojkam1@fel.cvut.cz</email>
</author>
<published>2015-10-19T14:51:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f6aad2615c8c4ed806e70693adacb6c93f13564a'/>
<id>f6aad2615c8c4ed806e70693adacb6c93f13564a</id>
<content type='text'>
Fixes: 31847b67bec0 ("kconfig: allow use of relations other than (in)equality")
Signed-off-by: Michal Sojka &lt;sojkam1@fel.cvut.cz&gt;
Reviewed-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>
Fixes: 31847b67bec0 ("kconfig: allow use of relations other than (in)equality")
Signed-off-by: Michal Sojka &lt;sojkam1@fel.cvut.cz&gt;
Reviewed-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.toradex.cn/cgit/linux-toradex.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: 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.toradex.cn/cgit/linux-toradex.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>
<entry>
<title>kconfig: Remove unnecessary prototypes from headers</title>
<updated>2015-02-25T14:00:17+00:00</updated>
<author>
<name>Michal Marek</name>
<email>mmarek@suse.cz</email>
</author>
<published>2015-02-24T15:37:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ad8d40cda3ad22ad9e8863d55a5c88f85c0173f0'/>
<id>ad8d40cda3ad22ad9e8863d55a5c88f85c0173f0</id>
<content type='text'>
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: Michal Marek &lt;mmarek@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kconfig: Remove dead code</title>
<updated>2015-02-25T14:00:16+00:00</updated>
<author>
<name>Michal Marek</name>
<email>mmarek@suse.cz</email>
</author>
<published>2015-02-24T15:32:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=463157444e377bf9b279101b1f16a94c4648c03a'/>
<id>463157444e377bf9b279101b1f16a94c4648c03a</id>
<content type='text'>
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: Michal Marek &lt;mmarek@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kconfig: Fix malloc handling in conf tools</title>
<updated>2012-11-20T11:12:47+00:00</updated>
<author>
<name>Alan Cox</name>
<email>alan@linux.intel.com</email>
</author>
<published>2012-11-06T14:32:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=177acf78468bf5c359bcb8823ee3bd48b04b8380'/>
<id>177acf78468bf5c359bcb8823ee3bd48b04b8380</id>
<content type='text'>
(and get them out of the noise in the audit work)

Signed-off-by: Alan Cox &lt;alan@linux.intel.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>
(and get them out of the noise in the audit work)

Signed-off-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kconfig: use calloc() for expr allocation</title>
<updated>2011-07-02T05:04:37+00:00</updated>
<author>
<name>Arnaud Lacombe</name>
<email>lacombar@gmail.com</email>
</author>
<published>2010-09-20T02:45:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8494453ad50599b0c9d099a230e423a89222ad08'/>
<id>8494453ad50599b0c9d099a230e423a89222ad08</id>
<content type='text'>
Signed-off-by: Arnaud Lacombe &lt;lacombar@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Arnaud Lacombe &lt;lacombar@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kconfig: nuke LKC_DIRECT_LINK cruft</title>
<updated>2011-06-06T19:32:20+00:00</updated>
<author>
<name>Arnaud Lacombe</name>
<email>lacombar@gmail.com</email>
</author>
<published>2011-06-01T20:14:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5a6f8d2bd9e3392569ed6f29ea4d7210652f929b'/>
<id>5a6f8d2bd9e3392569ed6f29ea4d7210652f929b</id>
<content type='text'>
This interface is not (and has never been ?) used by any frontend, just get rid
of it.

Signed-off-by: Arnaud Lacombe &lt;lacombar@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This interface is not (and has never been ?) used by any frontend, just get rid
of it.

Signed-off-by: Arnaud Lacombe &lt;lacombar@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kconfig: Make expr_copy() take a const argument</title>
<updated>2010-12-21T16:59:16+00:00</updated>
<author>
<name>Michal Marek</name>
<email>mmarek@suse.cz</email>
</author>
<published>2010-12-20T15:06:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=17742dc743716eebbf5892add0e0bf91f541fc39'/>
<id>17742dc743716eebbf5892add0e0bf91f541fc39</id>
<content type='text'>
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: Michal Marek &lt;mmarek@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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: Michal Marek &lt;mmarek@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kconfig: simplify select-with-unmet-direct-dependency warning</title>
<updated>2010-12-21T16:59:14+00:00</updated>
<author>
<name>Arnaud Lacombe</name>
<email>lacombar@gmail.com</email>
</author>
<published>2010-09-26T20:24:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1137c56b7420c801147e0863845c03b07554721a'/>
<id>1137c56b7420c801147e0863845c03b07554721a</id>
<content type='text'>
This is an attempt to simplify the expressing printed by kconfig when a
symbol is selected but still has direct unmet dependency.

First, the symbol reverse dependency is split in sub-expression. Then,
each sub-expression is checked to ensure that it does not contains the
unmet dependency. This removes the false-positive symbols and fixed symbol
which already have the correct dependency. Finally, only the symbol
responsible of the "select" is printed, instead of its full dependency tree.

CC: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Signed-off-by: Arnaud Lacombe &lt;lacombar@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>
This is an attempt to simplify the expressing printed by kconfig when a
symbol is selected but still has direct unmet dependency.

First, the symbol reverse dependency is split in sub-expression. Then,
each sub-expression is checked to ensure that it does not contains the
unmet dependency. This removes the false-positive symbols and fixed symbol
which already have the correct dependency. Finally, only the symbol
responsible of the "select" is printed, instead of its full dependency tree.

CC: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Signed-off-by: Arnaud Lacombe &lt;lacombar@gmail.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</pre>
</div>
</content>
</entry>
</feed>
