<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/common/cli_hush.c, branch v2023.07</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>common: cli_hush: Restore clear local variable support</title>
<updated>2023-05-03T22:30:46+00:00</updated>
<author>
<name>Stefan Herbrechtsmeier</name>
<email>stefan.herbrechtsmeier@weidmueller.com</email>
</author>
<published>2023-04-03T13:50:00+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=930ef109928969fa17b8ccf2a05aa4aeff10f3e3'/>
<id>930ef109928969fa17b8ccf2a05aa4aeff10f3e3</id>
<content type='text'>
The u-boot hush shell doesn’t support the unset command to clear a
variable and therefore an empty value ("c=") should be a valid value
for the set_local_var function to clear the variable. This partial
reverts commit aa722529635c ("common: cli_hush: avoid dead code") and
only checks for a `=` in the string. Additionally explicit call the
unset_local_var function to remove the variable if the value is empty.

Signed-off-by: Stefan Herbrechtsmeier &lt;stefan.herbrechtsmeier@weidmueller.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The u-boot hush shell doesn’t support the unset command to clear a
variable and therefore an empty value ("c=") should be a valid value
for the set_local_var function to clear the variable. This partial
reverts commit aa722529635c ("common: cli_hush: avoid dead code") and
only checks for a `=` in the string. Additionally explicit call the
unset_local_var function to remove the variable if the value is empty.

Signed-off-by: Stefan Herbrechtsmeier &lt;stefan.herbrechtsmeier@weidmueller.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd: exit: Fix return value propagation out of environment scripts</title>
<updated>2023-01-11T20:02:24+00:00</updated>
<author>
<name>Marek Vasut</name>
<email>marex@denx.de</email>
</author>
<published>2022-12-20T06:25:59+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=721307eba0e7d94241698936c58352ee3c6da748'/>
<id>721307eba0e7d94241698936c58352ee3c6da748</id>
<content type='text'>
Make sure the 'exit' command as well as 'exit $val' command exits
from environment scripts immediately and propagates return value
out of those scripts fully. That means the following behavior is
expected:

"
=&gt; setenv foo 'echo bar ; exit 1' ; run foo ; echo $?
bar
1
=&gt; setenv foo 'echo bar ; exit 0' ; run foo ; echo $?
bar
0
=&gt; setenv foo 'echo bar ; exit -2' ; run foo ; echo $?
bar
0
"

As well as the followin behavior:

"
=&gt; setenv foo 'echo bar ; exit 3 ; echo fail'; run foo; echo $?
bar
3
=&gt; setenv foo 'echo bar ; exit 1 ; echo fail'; run foo; echo $?
bar
1
=&gt; setenv foo 'echo bar ; exit 0 ; echo fail'; run foo; echo $?
bar
0
=&gt; setenv foo 'echo bar ; exit -1 ; echo fail'; run foo; echo $?
bar
0
=&gt; setenv foo 'echo bar ; exit -2 ; echo fail'; run foo; echo $?
bar
0
=&gt; setenv foo 'echo bar ; exit ; echo fail'; run foo; echo $?
bar
0
"

Fixes: 8c4e3b79bd0 ("cmd: exit: Fix return value")
Reviewed-by: Hector Palacios &lt;hector.palacios@digi.com&gt;
Signed-off-by: Marek Vasut &lt;marex@denx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make sure the 'exit' command as well as 'exit $val' command exits
from environment scripts immediately and propagates return value
out of those scripts fully. That means the following behavior is
expected:

"
=&gt; setenv foo 'echo bar ; exit 1' ; run foo ; echo $?
bar
1
=&gt; setenv foo 'echo bar ; exit 0' ; run foo ; echo $?
bar
0
=&gt; setenv foo 'echo bar ; exit -2' ; run foo ; echo $?
bar
0
"

As well as the followin behavior:

"
=&gt; setenv foo 'echo bar ; exit 3 ; echo fail'; run foo; echo $?
bar
3
=&gt; setenv foo 'echo bar ; exit 1 ; echo fail'; run foo; echo $?
bar
1
=&gt; setenv foo 'echo bar ; exit 0 ; echo fail'; run foo; echo $?
bar
0
=&gt; setenv foo 'echo bar ; exit -1 ; echo fail'; run foo; echo $?
bar
0
=&gt; setenv foo 'echo bar ; exit -2 ; echo fail'; run foo; echo $?
bar
0
=&gt; setenv foo 'echo bar ; exit ; echo fail'; run foo; echo $?
bar
0
"

Fixes: 8c4e3b79bd0 ("cmd: exit: Fix return value")
Reviewed-by: Hector Palacios &lt;hector.palacios@digi.com&gt;
Signed-off-by: Marek Vasut &lt;marex@denx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>global: Remove undef CONFIG_... for unused values</title>
<updated>2022-12-23T15:07:03+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2022-12-04T15:03:34+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=218ce3695bfd02f048443f888137e134dbcfcbfc'/>
<id>218ce3695bfd02f048443f888137e134dbcfcbfc</id>
<content type='text'>
We have a number of places that undef CONFIG_... while we never
reference CONFIG_... in the first place. Remove these lines.

Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We have a number of places that undef CONFIG_... while we never
reference CONFIG_... in the first place. Remove these lines.

Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cli: slighly more clear error messages</title>
<updated>2021-05-17T21:06:42+00:00</updated>
<author>
<name>peng.wang@smartm.com</name>
<email>peng.wang@smartm.com</email>
</author>
<published>2021-05-04T08:45:59+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=6c353b34cfd86797be25de8908695132646ef321'/>
<id>6c353b34cfd86797be25de8908695132646ef321</id>
<content type='text'>
This patch tries to distinguish two error messages.

Signed-off-by: peng.wang@smartm.com &lt;peng.wang@smartm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch tries to distinguish two error messages.

Signed-off-by: peng.wang@smartm.com &lt;peng.wang@smartm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hush: Fix assignments being misinterpreted as commands</title>
<updated>2021-04-12T21:17:11+00:00</updated>
<author>
<name>Sean Anderson</name>
<email>seanga2@gmail.com</email>
</author>
<published>2021-02-28T21:29:51+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=9539f71675c40485e448efb3c4e06afc8d102f94'/>
<id>9539f71675c40485e448efb3c4e06afc8d102f94</id>
<content type='text'>
If there were no variable substitutions in a command, then initial
assignments would be misinterpreted as commands, instead of being skipped
over. This is demonstrated by the following example:

	=&gt; foo=bar echo baz
	Unknown command 'foo=bar' - try 'help'

Signed-off-by: Sean Anderson &lt;seanga2@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If there were no variable substitutions in a command, then initial
assignments would be misinterpreted as commands, instead of being skipped
over. This is demonstrated by the following example:

	=&gt; foo=bar echo baz
	Unknown command 'foo=bar' - try 'help'

Signed-off-by: Sean Anderson &lt;seanga2@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>common: Drop asm/global_data.h from common header</title>
<updated>2021-02-02T20:33:42+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2020-10-31T03:38:53+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=401d1c4f5d2d29c4bc4beaec95402ca23eb63295'/>
<id>401d1c4f5d2d29c4bc4beaec95402ca23eb63295</id>
<content type='text'>
Move this out of the common header and include it only where needed.  In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly.   Finally, we have a few
cases where we did not need to include &lt;asm/global_data.h&gt; at all, so
remove that include.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move this out of the common header and include it only where needed.  In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly.   Finally, we have a few
cases where we did not need to include &lt;asm/global_data.h&gt; at all, so
remove that include.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd: Kconfig: migrate CONFIG_SYS_PROMPT_HUSH_PS2</title>
<updated>2020-12-01T19:12:28+00:00</updated>
<author>
<name>Patrick Delaunay</name>
<email>patrick.delaunay@st.com</email>
</author>
<published>2020-10-26T08:31:42+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=48aee0afb62ee4ce11dd882600cfbcda60efb563'/>
<id>48aee0afb62ee4ce11dd882600cfbcda60efb563</id>
<content type='text'>
Move CONFIG_SYS_PROMPT_HUSH_PS2 in Kconfig, depending
on CONFIG_HUSH_PARSER, and remove the default value defined
in cli_hush.c under __U_BOOT__.

Signed-off-by: Patrick Delaunay &lt;patrick.delaunay@st.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move CONFIG_SYS_PROMPT_HUSH_PS2 in Kconfig, depending
on CONFIG_HUSH_PARSER, and remove the default value defined
in cli_hush.c under __U_BOOT__.

Signed-off-by: Patrick Delaunay &lt;patrick.delaunay@st.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cli_hush.c: remove broken sanity check</title>
<updated>2020-10-22T13:54:53+00:00</updated>
<author>
<name>Rasmus Villemoes</name>
<email>rasmus.villemoes@prevas.dk</email>
</author>
<published>2020-10-07T07:36:03+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=8d5d97cb28bf2ac1e0d7e4b24620c56f3fe45e6f'/>
<id>8d5d97cb28bf2ac1e0d7e4b24620c56f3fe45e6f</id>
<content type='text'>
This code is intended do prevent one from setting a shell variable abc
by doing

  abc=123

if an environment variable named abc already exists. However, the
check is broken, since the env_get is done before the split on =, so
we look up whether an environment variable "abc=123" exists, which is
obviously never the case.

One could move the code to below the split on =, but instead, just
remove it, saving a little .text: The check has never worked as
intended (it goes all the way back to the initial git commit), and it
would anyway not guard against one first setting the shell variable,
then doing 'env set abc xyz'.

Signed-off-by: Rasmus Villemoes &lt;rasmus.villemoes@prevas.dk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This code is intended do prevent one from setting a shell variable abc
by doing

  abc=123

if an environment variable named abc already exists. However, the
check is broken, since the env_get is done before the split on =, so
we look up whether an environment variable "abc=123" exists, which is
obviously never the case.

One could move the code to below the split on =, but instead, just
remove it, saving a little .text: The check has never worked as
intended (it goes all the way back to the initial git commit), and it
would anyway not guard against one first setting the shell variable,
then doing 'env set abc xyz'.

Signed-off-by: Rasmus Villemoes &lt;rasmus.villemoes@prevas.dk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>command: Remove the cmd_tbl_t typedef</title>
<updated>2020-05-18T22:36:55+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2020-05-10T17:40:03+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=09140113108541b95d340f3c7b6ee597d31ccc73'/>
<id>09140113108541b95d340f3c7b6ee597d31ccc73</id>
<content type='text'>
We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hush: avoid NULL check before free()</title>
<updated>2020-05-01T15:34:01+00:00</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>xypron.glpk@gmx.de</email>
</author>
<published>2020-04-28T19:56:10+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=f4070e6f6c680034d67f13b878f0da55b3b51f92'/>
<id>f4070e6f6c680034d67f13b878f0da55b3b51f92</id>
<content type='text'>
free() checks if its argument is NULL. Don't duplicate this in the calling
code.

Signed-off-by: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
free() checks if its argument is NULL. Don't duplicate this in the calling
code.

Signed-off-by: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
