devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/2]  Add node and property realloc functions.
@ 2013-04-10 14:31 Srinivas KANDAGATLA
       [not found] ` <1365604278-17956-1-git-send-email-srinivas.kandagatla-qxv4g6HH51o@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Srinivas KANDAGATLA @ 2013-04-10 14:31 UTC (permalink / raw)
  To: jdl-CYoMK+44s/E
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	dwg-8fk3Idey6ehBDgjK7y7TUQ, srinivas.kandagatla-qxv4g6HH51o

If you try to insert a new node or extend a property with large value, 
using fdtput you will notice that it always fails.

example:
fdtput -v -p -ts ./tst.dtb "/node-1" "property-1" "str10"
Error at 'node-1': FDT_ERR_NOSPACE

or

fdtput -v -c ./tst.dtb "/node-1"
Error at 'node-1': FDT_ERR_NOSPACE


fdtput -v  -ts ./tst.dtb "/node" "property" "very big value"
Decoding value:
	string: 'very big value'
Value size 15
Error at 'property': FDT_ERR_NOSPACE

All these error are returned from libfdt, as the size of the fdt passed
has not space to accomdate these new properties.

However,
libfdt has code to add new property or node or extend a property to an
arbitary value, however it cannot be used because all the library
functions take preallocated fdt pointer limted to a size.

Adding realloc function into libfdt can help tools like fdtput to insert
nodes or properties or extend a property.

As libfdt has knowlege of how much space a new property or node can take.
This patch set attempts to fix this issue by adding new libary functions
fdt_realloc_property and fdt_realloc_node.

comments?

Srinivas Kandagatla (2):
  libfdt: Add node and property realloc functions.
  fdtput: use libfdt realloc functions.

 fdtput.c        |   30 +++++++++++++++++-------------
 libfdt/fdt_rw.c |   39 +++++++++++++++++++++++++++++++++++++++
 libfdt/libfdt.h |    4 ++++
 3 files changed, 60 insertions(+), 13 deletions(-)

-- 
1.7.6.5

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-04-11  6:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-10 14:31 [RFC 0/2] Add node and property realloc functions Srinivas KANDAGATLA
     [not found] ` <1365604278-17956-1-git-send-email-srinivas.kandagatla-qxv4g6HH51o@public.gmane.org>
2013-04-10 14:33   ` [RFC 1/2] libfdt: " Srinivas KANDAGATLA
     [not found]     ` <1365604398-18064-1-git-send-email-srinivas.kandagatla-qxv4g6HH51o@public.gmane.org>
2013-04-11  1:46       ` David Gibson
2013-04-10 14:33   ` [RFC 2/2] fdtput: use libfdt " Srinivas KANDAGATLA
2013-04-11  1:44   ` [RFC 0/2] Add node and property " David Gibson
     [not found]     ` <20130411014439.GN8165-W9XWwYn+TF0XU02nzanrWNbf9cGiqdzd@public.gmane.org>
2013-04-11  6:52       ` Srinivas KANDAGATLA

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).