<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/lib/libfdt/fdt.c, branch master</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>lib: libfdt: wrap scripts/dtc/libfdt/* where possible</title>
<updated>2017-11-17T12:44:13+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2017-10-17T13:30:20+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=50a327ded68b7e675389ad284ea3f8c62e683bda'/>
<id>50a327ded68b7e675389ad284ea3f8c62e683bda</id>
<content type='text'>
lib/libfdt/ and scripts/dtc/libfdt have the same copies for the
followings 6 files:
  fdt.c fdt_addresses.c fdt_empty_tree.c fdt_overlay.c fdt_strerr.c
  fdt_sw.c

Make them a wrapper of scripts/dtc/libfdt/*.  This is exactly what
Linux does to sync libfdt.  In order to make is possible, import
&lt;linux/libfdt.h&gt; and &lt;linux/libfdt_env.h&gt; from Linux 4.14-rc5.

Unfortunately, U-Boot locally modified the following 3 files:
  fdt_ro.c fdt_wip.c fdt_rw.c

The fdt_region.c is U-Boot own file.

I did not touch them in order to avoid unpredictable impact.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
lib/libfdt/ and scripts/dtc/libfdt have the same copies for the
followings 6 files:
  fdt.c fdt_addresses.c fdt_empty_tree.c fdt_overlay.c fdt_strerr.c
  fdt_sw.c

Make them a wrapper of scripts/dtc/libfdt/*.  This is exactly what
Linux does to sync libfdt.  In order to make is possible, import
&lt;linux/libfdt.h&gt; and &lt;linux/libfdt_env.h&gt; from Linux 4.14-rc5.

Unfortunately, U-Boot locally modified the following 3 files:
  fdt_ro.c fdt_wip.c fdt_rw.c

The fdt_region.c is U-Boot own file.

I did not touch them in order to avoid unpredictable impact.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libfdt: Fix undefined behaviour in fdt_offset_ptr()</title>
<updated>2016-10-13T19:54:10+00:00</updated>
<author>
<name>David Gibson</name>
<email>david@gibson.dropbear.id.au</email>
</author>
<published>2016-10-02T23:59:26+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=491c7b6f42a8101f1e84cf8e13a0e23b5eca729e'/>
<id>491c7b6f42a8101f1e84cf8e13a0e23b5eca729e</id>
<content type='text'>
Using pointer arithmetic to generate a pointer outside a known object is,
technically, undefined behaviour in C.  Unfortunately, we were using that
in fdt_offset_ptr() to detect overflows.

To fix this we need to do our bounds / overflow checking on the offsets
before constructing pointers from them.

Reported-by: David Binderman &lt;dcb314@hotmail.com&gt;
Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Using pointer arithmetic to generate a pointer outside a known object is,
technically, undefined behaviour in C.  Unfortunately, we were using that
in fdt_offset_ptr() to detect overflows.

To fix this we need to do our bounds / overflow checking on the offsets
before constructing pointers from them.

Reported-by: David Binderman &lt;dcb314@hotmail.com&gt;
Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/libfdt/: General aesthetic/style fixes.</title>
<updated>2016-06-19T23:05:55+00:00</updated>
<author>
<name>Robert P. J. Day</name>
<email>rpjday@crashcourse.ca</email>
</author>
<published>2016-05-23T09:40:55+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=6feed2a5aefb7fd0ac443a50bfe00625000bdd34'/>
<id>6feed2a5aefb7fd0ac443a50bfe00625000bdd34</id>
<content type='text'>
A number of style fixes across the files in this directory, including:

 * Correct invalid kernel-doc content.
 * Tidy up massive comment in fdt_region.c.
 * Use correct spelling of "U-Boot".
 * Replace tests of "! &lt;var&gt;" with "!&lt;var&gt;".
 * Replace "libfdt_env.h" with &lt;libfdt_env.h&gt;.

Signed-off-by: Robert P. J. Day &lt;rpjday@crashcourse.ca&gt;
Acked-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A number of style fixes across the files in this directory, including:

 * Correct invalid kernel-doc content.
 * Tidy up massive comment in fdt_region.c.
 * Use correct spelling of "U-Boot".
 * Replace tests of "! &lt;var&gt;" with "!&lt;var&gt;".
 * Replace "libfdt_env.h" with &lt;libfdt_env.h&gt;.

Signed-off-by: Robert P. J. Day &lt;rpjday@crashcourse.ca&gt;
Acked-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libfdt: SPDX-License-Identifier: GPL-2.0+ BSD-2-Clause</title>
<updated>2013-08-10T13:04:25+00:00</updated>
<author>
<name>Roger Meier</name>
<email>roger@bufferoverflow.ch</email>
</author>
<published>2013-07-26T23:12:38+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=35084760a9f492f29434020b64f1db339bf99a23'/>
<id>35084760a9f492f29434020b64f1db339bf99a23</id>
<content type='text'>
Signed-off-by: Roger Meier &lt;roger@bufferoverflow.ch&gt;
Acked-by: Wolfgang Denk &lt;wd@denx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Roger Meier &lt;roger@bufferoverflow.ch&gt;
Acked-by: Wolfgang Denk &lt;wd@denx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libfdt: Add fdt_next_subnode() to permit easy subnode iteration</title>
<updated>2013-05-14T19:37:25+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2013-05-07T06:11:50+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=88f95bbadda89bfaf6a8e817bb66fd114afc1caf'/>
<id>88f95bbadda89bfaf6a8e817bb66fd114afc1caf</id>
<content type='text'>
Iterating through subnodes with libfdt is a little painful to write as we
need something like this:

for (depth = 0, count = 0,
	offset = fdt_next_node(fdt, parent_offset, &amp;depth);
     (offset &gt;= 0) &amp;&amp; (depth &gt; 0);
     offset = fdt_next_node(fdt, offset, &amp;depth)) {
	if (depth == 1) {
		/* code body */
	}
}

Using fdt_next_subnode() we can instead write this, which is shorter and
easier to get right:

for (offset = fdt_first_subnode(fdt, parent_offset);
     offset &gt;= 0;
     offset = fdt_next_subnode(fdt, offset)) {
	/* code body */
}

Also, it doesn't require two levels of indentation for the loop body.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
(Cherry-picked from dtc commit 4e76ec79)
Acked-by: Gerald Van Baren &lt;vanbaren@cideas.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Iterating through subnodes with libfdt is a little painful to write as we
need something like this:

for (depth = 0, count = 0,
	offset = fdt_next_node(fdt, parent_offset, &amp;depth);
     (offset &gt;= 0) &amp;&amp; (depth &gt; 0);
     offset = fdt_next_node(fdt, offset, &amp;depth)) {
	if (depth == 1) {
		/* code body */
	}
}

Using fdt_next_subnode() we can instead write this, which is shorter and
easier to get right:

for (offset = fdt_first_subnode(fdt, parent_offset);
     offset &gt;= 0;
     offset = fdt_next_subnode(fdt, offset)) {
	/* code body */
}

Also, it doesn't require two levels of indentation for the loop body.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
(Cherry-picked from dtc commit 4e76ec79)
Acked-by: Gerald Van Baren &lt;vanbaren@cideas.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libfdt: update from upstream dtc commit 142419e</title>
<updated>2013-02-08T01:38:55+00:00</updated>
<author>
<name>Kim Phillips</name>
<email>kim.phillips@freescale.com</email>
</author>
<published>2013-01-16T13:59:50+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b2ba62a1aa7f2b68c418cf44ab15eee718913272'/>
<id>b2ba62a1aa7f2b68c418cf44ab15eee718913272</id>
<content type='text'>
commit 142419e "dtc/libfdt: sparse fixes", for u-boot's libfdt copy.

Signed-off-by: Kim Phillips &lt;kim.phillips@freescale.com&gt;
Cc: Jerry Van Baren &lt;gvb.uboot@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 142419e "dtc/libfdt: sparse fixes", for u-boot's libfdt copy.

Signed-off-by: Kim Phillips &lt;kim.phillips@freescale.com&gt;
Cc: Jerry Van Baren &lt;gvb.uboot@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libfdt: Implement property iteration functions</title>
<updated>2011-07-15T01:10:34+00:00</updated>
<author>
<name>David Gibson</name>
<email>david@gibson.dropbear.id.au</email>
</author>
<published>2010-03-09T06:39:14+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d1c6314887c4d6712f7bd9ba7428b6517e7732e0'/>
<id>d1c6314887c4d6712f7bd9ba7428b6517e7732e0</id>
<content type='text'>
For ages, we've been talking about adding functions to libfdt to allow
iteration through properties.  So, finally, here are some.

I got bogged down on this for a long time because I didn't want to
expose offsets directly to properties to the callers.  But without
that, attempting to make reasonable iteration functions just became
horrible.  So eventually, I settled on an interface which does now
expose property offsets.  fdt_first_property_offset() and
fdt_next_property_offset() are used to step through the offsets of the
properties starting from a particularly node offset.  The details of
the property at each offset can then be retrieved with either
fdt_get_property_by_offset() or fdt_getprop_by_offset() which have
interfaces similar to fdt_get_property() and fdt_getprop()
respectively.

No explicit testcases are included, but we do use the new functions to
reimplement the existing fdt_get_property() function.

Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;

This was extracted from the DTC commit:
73dca9ae0b9abe6924ba640164ecce9f8df69c5a Mon Sep 17 00:00:00 2001

Signed-off-by: Gerald Van Baren &lt;vanbaren@cideas.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For ages, we've been talking about adding functions to libfdt to allow
iteration through properties.  So, finally, here are some.

I got bogged down on this for a long time because I didn't want to
expose offsets directly to properties to the callers.  But without
that, attempting to make reasonable iteration functions just became
horrible.  So eventually, I settled on an interface which does now
expose property offsets.  fdt_first_property_offset() and
fdt_next_property_offset() are used to step through the offsets of the
properties starting from a particularly node offset.  The details of
the property at each offset can then be retrieved with either
fdt_get_property_by_offset() or fdt_getprop_by_offset() which have
interfaces similar to fdt_get_property() and fdt_getprop()
respectively.

No explicit testcases are included, but we do use the new functions to
reimplement the existing fdt_get_property() function.

Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;

This was extracted from the DTC commit:
73dca9ae0b9abe6924ba640164ecce9f8df69c5a Mon Sep 17 00:00:00 2001

Signed-off-by: Gerald Van Baren &lt;vanbaren@cideas.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Move libfdt/ into lib/</title>
<updated>2010-04-13T07:13:04+00:00</updated>
<author>
<name>Peter Tyser</name>
<email>ptyser@xes-inc.com</email>
</author>
<published>2010-04-13T03:28:06+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=0de71d507157c4bd4fddcd3a419140d2b986eed2'/>
<id>0de71d507157c4bd4fddcd3a419140d2b986eed2</id>
<content type='text'>
Move the libfdt directory into the common lib/ directory to clean up the
top-level directory.

Signed-off-by: Peter Tyser &lt;ptyser@xes-inc.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move the libfdt directory into the common lib/ directory to clean up the
top-level directory.

Signed-off-by: Peter Tyser &lt;ptyser@xes-inc.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
