<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/common/cmd_i2c.c, branch v2010.09</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>CMD_I2C: make alen=0 work</title>
<updated>2010-08-26T06:33:24+00:00</updated>
<author>
<name>Reinhard Meyer</name>
<email>u-boot@emk-elektronik.de</email>
</author>
<published>2010-08-25T12:41:16+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=7a92e53cd0d8164d518216bebd52679603d6ffe9'/>
<id>7a92e53cd0d8164d518216bebd52679603d6ffe9</id>
<content type='text'>
Signed-off-by: Reinhard Meyer &lt;u-boot@emk-elektronik.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Reinhard Meyer &lt;u-boot@emk-elektronik.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd_usage(): simplify return code handling</title>
<updated>2010-07-24T18:43:57+00:00</updated>
<author>
<name>Wolfgang Denk</name>
<email>wd@denx.de</email>
</author>
<published>2010-07-16T23:06:04+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=47e26b1bf91ddef69f4a3892815c857db094cef9'/>
<id>47e26b1bf91ddef69f4a3892815c857db094cef9</id>
<content type='text'>
Lots of code use this construct:

	cmd_usage(cmdtp);
	return 1;

Change cmd_usage() let it return 1 - then we can replace all these
ocurrances by

	return cmd_usage(cmdtp);

This fixes a few places with incorrect return code handling, too.

Signed-off-by: Wolfgang Denk &lt;wd@denx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Lots of code use this construct:

	cmd_usage(cmdtp);
	return 1;

Change cmd_usage() let it return 1 - then we can replace all these
ocurrances by

	return cmd_usage(cmdtp);

This fixes a few places with incorrect return code handling, too.

Signed-off-by: Wolfgang Denk &lt;wd@denx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Make sure that argv[] argument pointers are not modified.</title>
<updated>2010-07-04T21:55:42+00:00</updated>
<author>
<name>Wolfgang Denk</name>
<email>wd@denx.de</email>
</author>
<published>2010-06-28T20:00:46+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=54841ab50c20d6fa6c9cc3eb826989da3a22d934'/>
<id>54841ab50c20d6fa6c9cc3eb826989da3a22d934</id>
<content type='text'>
The hush shell dynamically allocates (and re-allocates) memory for the
argument strings in the "char *argv[]" argument vector passed to
commands.  Any code that modifies these pointers will cause serious
corruption of the malloc data structures and crash U-Boot, so make
sure the compiler can check that no such modifications are being done
by changing the code into "char * const argv[]".

This modification is the result of debugging a strange crash caused
after adding a new command, which used the following argument
processing code which has been working perfectly fine in all Unix
systems since version 6 - but not so in U-Boot:

int main (int argc, char **argv)
{
	while (--argc &gt; 0 &amp;&amp; **++argv == '-') {
/* ====&gt; */	while (*++*argv) {
			switch (**argv) {
			case 'd':
				debug++;
				break;
			...
			default:
				usage ();
			}
		}
	}
	...
}

The line marked "====&gt;" will corrupt the malloc data structures and
usually cause U-Boot to crash when the next command gets executed by
the shell.  With the modification, the compiler will prevent this with
an
	error: increment of read-only location '*argv'

N.B.: The code above can be trivially rewritten like this:

	while (--argc &gt; 0 &amp;&amp; **++argv == '-') {
		char *arg = *argv;
		while (*++arg) {
			switch (*arg) {
			...

Signed-off-by: Wolfgang Denk &lt;wd@denx.de&gt;
Acked-by: Mike Frysinger &lt;vapier@gentoo.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The hush shell dynamically allocates (and re-allocates) memory for the
argument strings in the "char *argv[]" argument vector passed to
commands.  Any code that modifies these pointers will cause serious
corruption of the malloc data structures and crash U-Boot, so make
sure the compiler can check that no such modifications are being done
by changing the code into "char * const argv[]".

This modification is the result of debugging a strange crash caused
after adding a new command, which used the following argument
processing code which has been working perfectly fine in all Unix
systems since version 6 - but not so in U-Boot:

int main (int argc, char **argv)
{
	while (--argc &gt; 0 &amp;&amp; **++argv == '-') {
/* ====&gt; */	while (*++*argv) {
			switch (**argv) {
			case 'd':
				debug++;
				break;
			...
			default:
				usage ();
			}
		}
	}
	...
}

The line marked "====&gt;" will corrupt the malloc data structures and
usually cause U-Boot to crash when the next command gets executed by
the shell.  With the modification, the compiler will prevent this with
an
	error: increment of read-only location '*argv'

N.B.: The code above can be trivially rewritten like this:

	while (--argc &gt; 0 &amp;&amp; **++argv == '-') {
		char *arg = *argv;
		while (*++arg) {
			switch (*arg) {
			...

Signed-off-by: Wolfgang Denk &lt;wd@denx.de&gt;
Acked-by: Mike Frysinger &lt;vapier@gentoo.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: made unused function i2c_mux_add_device static</title>
<updated>2010-03-29T11:29:12+00:00</updated>
<author>
<name>Frans Meulenbroeks</name>
<email>fransmeulenbroeks@gmail.com</email>
</author>
<published>2010-03-26T08:46:42+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=fd03ea89641d6f6ade6d1a8580c1bb9f52b8542c'/>
<id>fd03ea89641d6f6ade6d1a8580c1bb9f52b8542c</id>
<content type='text'>
and removed it from the .h file

Signed-off-by: Frans Meulenbroeks &lt;fransmeulenbroeks@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
and removed it from the .h file

Signed-off-by: Frans Meulenbroeks &lt;fransmeulenbroeks@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd_i2c: introduced get_alen helper function</title>
<updated>2010-03-29T11:28:57+00:00</updated>
<author>
<name>Frans Meulenbroeks</name>
<email>fransmeulenbroeks@gmail.com</email>
</author>
<published>2010-03-26T08:46:41+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=2c0dc990202c69a6231122ec2463c4e3076a16f3'/>
<id>2c0dc990202c69a6231122ec2463c4e3076a16f3</id>
<content type='text'>
The code to parse alen appeared 6 times in the function.
Factored this out in a small helper function

Signed-off-by: Frans Meulenbroeks &lt;fransmeulenbroeks@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The code to parse alen appeared 6 times in the function.
Factored this out in a small helper function

Signed-off-by: Frans Meulenbroeks &lt;fransmeulenbroeks@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd_i2c: moved a define to before the functions</title>
<updated>2010-03-29T11:28:49+00:00</updated>
<author>
<name>Frans Meulenbroeks</name>
<email>fransmeulenbroeks@gmail.com</email>
</author>
<published>2010-03-26T08:46:40+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=a266fe955a55bb7a03a67f3c91033068f317b337'/>
<id>a266fe955a55bb7a03a67f3c91033068f317b337</id>
<content type='text'>
Signed-off-by: Frans Meulenbroeks &lt;fransmeulenbroeks@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Frans Meulenbroeks &lt;fransmeulenbroeks@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd_i2c: moved mispositioned comment for i2c md</title>
<updated>2010-03-29T11:28:40+00:00</updated>
<author>
<name>Frans Meulenbroeks</name>
<email>fransmeulenbroeks@gmail.com</email>
</author>
<published>2010-03-26T08:46:39+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=4a8cf3382a6fea5cccc1e2ae61a4601bf26490c3'/>
<id>4a8cf3382a6fea5cccc1e2ae61a4601bf26490c3</id>
<content type='text'>
Signed-off-by: Frans Meulenbroeks &lt;fransmeulenbroeks@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Frans Meulenbroeks &lt;fransmeulenbroeks@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd_i2c.c: declared local functions as static</title>
<updated>2010-03-29T11:25:43+00:00</updated>
<author>
<name>Frans Meulenbroeks</name>
<email>fransmeulenbroeks@gmail.com</email>
</author>
<published>2010-03-26T08:46:38+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=3a6dcb988eee3fd3cd9c5ef96855a8da729a290e'/>
<id>3a6dcb988eee3fd3cd9c5ef96855a8da729a290e</id>
<content type='text'>
Declared all functions that were not called outside the file as static

Signed-off-by: Frans Meulenbroeks &lt;fransmeulenbroeks@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Declared all functions that were not called outside the file as static

Signed-off-by: Frans Meulenbroeks &lt;fransmeulenbroeks@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd_i2c.c: added i2c read to memory function</title>
<updated>2010-03-21T21:44:43+00:00</updated>
<author>
<name>Frans Meulenbroeks</name>
<email>fransmeulenbroeks@gmail.com</email>
</author>
<published>2010-02-25T09:12:16+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=652e53546b23c25f80756287eaf607b713afdc87'/>
<id>652e53546b23c25f80756287eaf607b713afdc87</id>
<content type='text'>
Signed-off-by: Frans Meulenbroeks &lt;fransmeulenbroeks@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Frans Meulenbroeks &lt;fransmeulenbroeks@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd_i2c.c: sorted commands alphabetically</title>
<updated>2010-03-21T21:44:43+00:00</updated>
<author>
<name>Frans Meulenbroeks</name>
<email>fransmeulenbroeks@gmail.com</email>
</author>
<published>2010-02-25T09:12:15+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=fb0070e9101a1f288d7054f7e80b3d808fd7ead2'/>
<id>fb0070e9101a1f288d7054f7e80b3d808fd7ead2</id>
<content type='text'>
Signed-off-by: Frans Meulenbroeks &lt;fransmeulenbroeks@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Frans Meulenbroeks &lt;fransmeulenbroeks@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
