summaryrefslogtreecommitdiffstats
path: root/cpukit/dtc (follow)
Commit message (Collapse)AuthorAgeFilesLines
* dtc: Update VERSIONSebastian Huber2020-03-021-3/+3
|
* libfdt: Allow exclusion of fdt_check_full()Simon Glass2020-03-021-63/+0
| | | | | | | | | | This function is used to perform a full check of the device tree. Allow it to be excluded if all assumptions are enabled. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Message-Id: <20200220214557.176528-9-sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: Add support for disabling ordering check/fixupSimon Glass2020-03-021-1/+2
| | | | | | | | | | Add a way to remove this check and the reordering code, which is unnecessary if the dtb is known to be correctly ordered. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Message-Id: <20200220214557.176528-8-sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: Add support for disabling version checksSimon Glass2020-03-023-24/+32
| | | | | | | | | Allow enabling FDT_ASSUME_LATEST to disable version checks. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Message-Id: <20200220214557.176528-7-sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: Add support for disabling rollback handlingSimon Glass2020-03-021-3/+15
| | | | | | | | | | Allow enabling FDT_ASSUME_NO_ROLLBACK to disable rolling back after a failed operation. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Message-Id: <20200220214557.176528-6-sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: Add support for disabling sanity checksSimon Glass2020-03-022-24/+48
| | | | | | | | | | Allow enabling ASSUME_VALID_INPUT to disable sanity checks on the device tree and the parameters to libfdt. This assumption covers that cases where the problem could be with either. Signed-off-by: Simon Glass <sjg@chromium.org> Message-Id: <20200220214557.176528-5-sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: Add support for disabling dtb checksSimon Glass2020-03-024-29/+45
| | | | | | | | | | | Support ASSUME_VALID_DTB to disable some sanity checks If we assume that the DTB itself is valid then we can skip some checks and save code space. Add various conditions to handle this. Signed-off-by: Simon Glass <sjg@chromium.org> Message-Id: <20200220214557.176528-4-sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* Add a way to control the level of checks in the codeSimon Glass2020-03-021-0/+104
| | | | | | | | | | | | | Add a new ASSUME_MASK option, which allows for some control over the checks used in libfdt. With all assumptions enabled, libfdt assumes that the input data and parameters are all correct and that internal errors cannot happen. By default no assumptions are made and all checks are enabled. Signed-off-by: Simon Glass <sjg@chromium.org> Message-Id: <20200220214557.176528-3-sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: De-inline fdt_header_size()Simon Glass2020-03-021-0/+5
| | | | | | | | | | | There does not seem to be a strong reason to inline this function. Also we are about to add some extra code to it which will increase its size. Move it into fdt.c and use a simple declaration in libfdt.h Signed-off-by: Simon Glass <sjg@chromium.org> Message-Id: <20200220214557.176528-2-sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: Correct prototype for fdt_ro_probe_()David Gibson2020-03-021-2/+2
| | | | | | | | | | | This function returns an int32_t, however the prototype in libfdt_internal.h shows it returning an int. We haven't caught this before because they're the same type on nearly all platforms this gets built on. Apparently it's not the case on FreeRTOS, so someone hit this mismatch building for that platform. Reported-by: dharani kumar <dharanikumarsrvn@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: Allow #size-cells of 0David Gibson2020-03-021-3/+5
| | | | | | | | | | | | | | | | | | c12b2b0c20eb "libfdt: fdt_address_cells() and fdt_size_cells()" introduced a bug as it consolidated code between the helpers for getting #address-cells and #size-cells. Specifically #size-cells is allowed to be 0, and is frequently found so in practice for /cpus. IEEE1275 only requires implementations to handle 1..4 for #address-cells, although one could make a case for #address-cells == #size-cells == 0 being used to represent a bridge with a single port. While we're there, it's not totally obvious that the existing implicit cast of a u32 to int will give the correct results according to strict C, although it does work in practice. Straighten that up to cast only after we've made our range checks. Reported-by: yonghuhaige via https://github.com/dgibson/dtc/issues/28 Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: Tweak data handling to satisfy CoverityDavid Gibson2020-03-023-12/+18
| | | | | | | | | | | | | | | | | | | | | | | In libfdt we often sanity test fdt_totalsize(fdt) fairly early, then trust it (but *only* that header field) for the remainder of our work. However, Coverity gets confused by this - it sees the byteswap in fdt32_ld() and assumes that means it is coming from an untrusted source everytime, resulting in many tainted data warnings. Most of these end up with logic in fdt_get_string() as the unsafe destination for this tainted data, so let's tweak the logic there to make it clearer to Coverity that this is ok. We add a sanity test on fdt_totalsize() to fdt_probe_ro_(). Because the interface allows bare ints to be used for offsets, we already have the assumption that totalsize must be 31-bits or less (2GiB would be a ludicrously large fdt). This makes this more explicit. We also make fdt_probe_ro() return the size for convenience, and change the logic in fdt_get_string() to keep it in a local so that Coverity can see that it has already been bounds-checked. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: Replace GPL/BSD boilerplate/reference with SPDX tagsRob Herring2020-03-029-413/+9
| | | | | | | | Replace instances of dual GPLv2 or BSD license boilerplate with SPDX tags. Signed-off-by: Rob Herring <robh@kernel.org> Message-Id: <20190620211944.9378-3-robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: Add FDT_CREATE_FLAG_NO_NAME_DEDUP flag that trades size for speedNicholas Piggin2020-03-021-13/+26
| | | | | | | | | | | | | Searching for duplicate names scales O(n^2) with the number of names added to a fdt, which can cause a noticable slowdown with larger device trees and very slow CPU cores. Add FDT_CREATE_FLAG_NO_NAME_DEDUP that allow the caller to trade fdt size for speed in the creation process. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Message-Id: <20190509094122.834-4-npiggin@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: Introduce fdt_create_with_flags()Nicholas Piggin2020-03-022-2/+29
| | | | | | | | | | | | | | | | | | | | | | | There is a need to be able to specify some options when building an FDT with the SW interface. This can be accomplished with minimal changes by storing intermediate data in the fdt header itself, in fields that are not otherwise needed during the creation process and can be set by fdt_finish(). The fdt.magic field is already used exactly this way, as a state to check with callers that the FDT has been created but not yet finished. fdt.version and fdt.last_comp_version are used to make room for more intermediate state. These are adjacent and unused during the building process. last_comp_version is not yet used for intermediate state, but it is zeroed and treated as used, so as to allow future growth easily. A new interface, fdt_create_with_flags() is added, which takes 32-bit flag value to control creation. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Message-Id: <20190509094122.834-3-npiggin@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: Ensure fdt_add_property frees allocated name string on failureNicholas Piggin2020-03-022-6/+39
| | | | | | | | | | | | | If fdt_add_property or fdt_property_placeholder fail after allocating a string for the name, they return without freeing that string. This does not change the structure of the tree, but in very specific cases it could lead to undesirable space consumption. Fix this by rolling back the string allocation in this situation. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Message-Id: <20190509094122.834-2-npiggin@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: Make fdt_get_max_phandle() an inlineDavid Gibson2020-03-021-12/+0
| | | | | | | | | | It's now a trivial wrapper around fdt_find_max_phandle() so we might as well inline it. We also remove it from the versioning linker script. Theoretically, that's a breaking ABI change except that we haven't yet released a version with it exposed in the shared object, so we can get away with it. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: Add phandle generation helperThierry Reding2020-03-021-0/+18
| | | | | | | | | | | | | | | | | The new fdt_generate_phandle() function can be used to generate a new, unused phandle given a specific device tree blob. The implementation is somewhat naive in that it simply walks the entire device tree to find the highest phandle value and then returns a phandle value one higher than that. A more clever implementation might try to find holes in the current set of phandle values and fill them. But this implementation is relatively simple and works reliably. Also add a test that validates that phandles generated by this new API are indeed unique. Signed-off-by: Thierry Reding <treding@nvidia.com> Message-Id: <20190326153302.17109-3-thierry.reding@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: Add new maximum phandle lookup functionThierry Reding2020-03-021-15/+29
| | | | | | | | | | | | | | | | | | | | | | The fdt_get_max_phandle() function has some shortcomings. On one hand it returns just a uint32_t which means to check for the "negative" error code a caller has to explicitly check against the error code (uint32_t)-1. In addition, the -1 is the only error code that can be returned, so a caller cannot tell the difference between the various failures. Fix this by adding a new fdt_find_max_phandle() function that returns an error code on failure and 0 on success, just like other APIs, and stores the maximum phandle value in an output argument on success. This also refactors fdt_get_max_phandle() to use the new function. Add a note pointing out that the new fdt_find_max_phandle() function should be preferred over fdt_get_max_phandle(). Signed-off-by: Thierry Reding <treding@nvidia.com> Message-Id: <20190326153302.17109-1-thierry.reding@gmail.com> [dwg: Reword for some inaccuracies in the commit message] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: add fdt_append_addrrange()AKASHI Takahiro2020-03-021-0/+47
| | | | | | | | | | | | | This function will append an address range property using parent node's "#address-cells" and "#size-cells" properties. It will be used in implementing kdump with kexec_file_load system call at linux kernel for arm64 once it is merged into kernel tree. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Message-Id: <20190327061552.17170-2-takahiro.akashi@linaro.org> [dwg: Correct a SEGV error in the testcase] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* Revert "libfdt: Add phandle generation helper"David Gibson2020-03-021-31/+0
| | | | | | This reverts commit 54ea41c22415cb0e283d22faf71202051c89400c. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: Add phandle generation helperThierry Reding2020-03-021-0/+31
| | | | | | | | | | | | | | | | | The new fdt_generate_phandle() function can be used to generate a new, unused phandle given a specific device tree blob. The implementation is somewhat naive in that it simply walks the entire device tree to find the highest phandle value and then returns a phandle value one higher than that. A more clever implementation might try to find holes in the current set of phandle values and fill them. But this implementation is relatively simple and works reliably. Also add a test that validates that phandles generated by this new API are indeed unique. Signed-off-by: Thierry Reding <treding@nvidia.com> Message-Id: <20190320151003.28941-1-thierry.reding@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: return correct value if #size-cells property is not presentJohn Clarke2020-03-021-3/+13
| | | | | | | | | | | | | According to the device tree specification, the default value for #size-cells is 1, but fdt_size_cells() was returning 2 if this property was not present. This patch also makes fdt_address_cells() and fdt_size_cells() conform to the behaviour documented in libfdt.h. The defaults are only returned if fdt_getprop() returns -FDT_ERR_NOTFOUND, otherwise the actual error is returned. Signed-off-by: John Clarke <johnc@kirriwa.net>
* build: Merge libfdt/Makefile.amSebastian Huber2018-10-091-15/+0
|
* build: Remove specialized CPPFLAGSSebastian Huber2018-10-091-1/+0
|
* dtc: Update VERSIONSebastian Huber2018-07-201-3/+3
|
* libfdt: fdt_address_cells() and fdt_size_cells()Sebastian Huber2018-07-201-22/+13
| | | | | | | | Add internal fdt_cells() to avoid copy and paste. Test error cases and default values. Fix typo in fdt_size_cells() documentation comment. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* dtc: Add VERSION fileSebastian Huber2018-07-191-0/+19
| | | | Close #3471.
* libfdt: Add necessary header padding in fdt_create()David Gibson2018-07-191-3/+7
| | | | | | | | | | | | | | | | | | At present fdt_create() will succeed if there is exactly enough space to put in the fdt header. However, it sets the off_mem_rsvmap field, a few bytes past that in order to align the memory reservation block. Having block pointers pointing past the end of the fdt is pretty ugly, even if it is just a transient state. Worse, if fdt_resize() is called at exactly the wrong time, it can end up accessing data past the blob's allocated space because of this. So, correct fdt_create() to ensure that there is sufficient space for the alignment padding as well as the plain header. For paranoia, also add a check in fdt_resize() to make sure we don't copy data from outside the blob's bounds. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: Copy the struct region in fdt_resize()Simon Glass2018-07-191-1/+1
| | | | | | | | | | | | At present this function appears to copy only the data before the struct region and the data in the string region. It does not seem to copy the struct region itself. From the arguments of this function it seems that it should support fdt and buf being different. This patch attempts to fix this problem. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: Add helpers for accessing unaligned wordsDavid Gibson2018-07-191-9/+9
| | | | | | | | | | | | | | | | | | This adds some helpers to load (32 or 64 bit) words from an fdt blob, even if they're unaligned and we're on a platform that doesn't like plain unaligned loads and stores. We then use the helpers in a number of places. There are two purposes for this: 1) This makes libfdt more robust against a blob loaded at an unaligned address. It's usually good practice to load a blob at a 64-bit alignment, but it's nice to work even then. 2) Users can use these helpers to load integer values from within property values. These can often be unaligned, even if the blob as a whole is aligned, since some property encodings have integers and strings mixed together without any alignment gaps. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: Add fdt_check_full() functionDavid Gibson2018-07-191-0/+63
| | | | | | | | | | | | | This new function implements a complete and thorough check of an fdt blob's structure. Given a buffer containing an fdt, it should return 0 only if the fdt within is structurally sound in all regards. It doesn't check anything about the blob's contents (i.e. the actual values of the nodes and properties), of course. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Simon Glass <sjg@chromium.org>
* libfdt: Add fdt_header_size()David Gibson2018-07-191-4/+16
| | | | | | | | | | | We have a couple of places within libfdt and its tests where we need to find the size of the header, based on the version. Add a helper function for it. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
* libfdt: Safer access to memory reservationsDavid Gibson2018-07-191-6/+27
| | | | | | | | | | | | | | | fdt_num_mem_rsv() and fdt_get_mem_rsv() currently don't sanity check their parameters, or the memory reserve section offset in the header. That means that on a corrupted blob they could access outside of the range of memory that they should. This improves their safety checking, meaning they shouldn't access outside the blob's bounds, even if its contents are badly corrupted. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Simon Glass <sjg@chromium.org>
* libfdt: Propagate name errors in fdt_getprop_by_offset()David Gibson2018-07-191-2/+12
| | | | | | | | | | | fdt_getprop_by_offset() doesn't check for errors from fdt_string() - after all, until very recently it couldn't fail. Now it can, so we need to propagate errors up to the caller. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Simon Glass <sjg@chromium.org>
* libfdt: Safer access to strings sectionDavid Gibson2018-07-191-3/+58
| | | | | | | | | | | | | | | | | | | | | | | fdt_string() is used to retrieve strings from a DT blob's strings section. It's rarely used directly, but is widely used internally. However, it doesn't do any bounds checking, which means in the case of a corrupted blob it could access bad memory, which libfdt is supposed to avoid. This write a safe alternative to fdt_string, fdt_get_string(). It checks both that the given offset is within the string section and that the string it points to is properly \0 terminated within the section. It also returns the string's length as a convenience (since it needs to determine to do the checks anyway). fdt_string() is rewritten in terms of fdt_get_string() for compatibility. Most of the diff here is actually testing infrastructure. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
* libfdt: Make fdt_check_header() more thoroughDavid Gibson2018-07-191-1/+56
| | | | | | | | | | | | | | | | | | | | | | | Currently fdt_check_header() performs only some rudimentary checks, which is not really what the name suggests. This strengthens fdt_check_header() to check as much about the blob as is possible from the header alone: as well as checking the magic number and version, it checks that the total size is sane, and that all the sub-blocks within the blob lie within the total size. * This broadens the meaning of FDT_ERR_TRUNCATED to cover all sorts of improperly terminated blocks as well as just a structure block without FDT_END. * This makes fdt_check_header() only succeed on "complete" blobs, not in-progress sequential write blobs. The only reason this didn't fail before was that this function used to be called by many RO functions which are supposed to also work on incomplete SW blobs. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Simon Glass <sjg@chromium.org>
* libfdt: Improve sequential write state checkingDavid Gibson2018-07-191-14/+75
| | | | | | | | | | | | | | | | | | When creating a tree with the sequential write functions, certain things have to be done in a certain order. You must create the memory reserve map and only then can you create the actual tree structure. The -FDT_ERR_BADSTATE return code is for if you try to do things out of order. However, we weren't checking that very thoroughly, so it was possible to generate a corrupted blob if, for example, you started calling fdt_begin_node() etc. before calling fdt_finish_reservemap(). This makes the state checking more thorough disallow that. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Simon Glass <sjg@chromium.org>
* libfdt: Clean up header checking functionsDavid Gibson2018-07-195-36/+47
| | | | | | | | | | | | | | | | | | | Many of the libfdt entry points call some sort of sanity check function before doing anything else. These need to do slightly different things for the various classes of functions. The read-only version is shared with the exported fdt_check_header(), which limits us a bit in how we can improve it. For that reason split the two functions apart (though the exported one just calls the ro one for now). We also rename the functions for more consistency - they're all named fdt_XX_probe_() where the XX indicates which class of functions they're for. "probe" is a better "term" than the previous check, since they really only do minimal validation. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
* Add limited read-only support for older (V2 and V3) device tree to libfdt.Nathan Whitehorn2018-07-192-15/+88
| | | | | | | | | | This can be useful in particular in the kernel when booting on systems with FDT-emitting firmware that is out of date. Releases of kexec-tools on ppc64 prior to the end of 2014 are notable examples of such. Signed-off-by: Nathan Whitehorn <nwhitehorn@freebsd.org> [dwg: Some whitespace cleanups] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: Remove leading underscores from identifiersDavid Gibson2018-07-196-99/+99
| | | | | | | | | | | | | | In a lot of places libfdt uses a leading _ character to mark an identifier as "internal" (not part of the published libfdt API). This is a bad idea, because identifiers with a leading _ are generally reserved by the C library or system. It's particularly dangerous for libfdt, because it's designed to be able to be integrated into lots of different environments. In some cases the leading _ has no purpose, so we simply drop it. In most cases we move it to the end, as our new convention for marking internal identifiers. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* Introduce fdt_setprop_placeholder() methodPantelis Antoniou2018-07-191-3/+17
| | | | | | | | | | | | In some cases you need to add a property but the contents of it are not known at creation time, merely the extend of it. This method allows you to create a property of a given size (filled with garbage) while a pointer to the property data will be provided. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> [dwg: Corrected commit message] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* Fix a few whitespace and style nitsSimon Glass2018-07-194-7/+6
| | | | | | | These were noticed when synching with U-Boot's downstream tree. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* Add a libfdt function to write a property placeholderSimon Glass2018-07-191-2/+14
| | | | | | | | | | | | | The existing function to add a new property to a tree being built requires that the entire contents of the new property be passed in. For some applications it is more convenient to be able to add the property contents later, perhaps by reading from a file. This avoids double-buffering of the contents. Add a new function to support this and adjust the existing fdt_property() to use it. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: Remove undefined behaviour setting empty propertiesDavid Gibson2018-07-191-1/+2
| | | | | | | | | | | | | | The standard way of setting an empty property using libfdt is: fdt_setprop(fdt, nodeoffset, propname, NULL, 0); However, the implementation of this includes an unconditional: memcpy(prop->data, NULL, 0); Which although it will be a no-op (which is what we want) on many platforms is technically undefined behaviour. Correct this, so that when passing a 0 length, passing a NULL pointer as the value to fdt_setprop() is definitely safe. This should quiet static checkers which complain about this. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: add missing errors to fdt_strerror()Benjamin Fair2018-07-191-0/+3
| | | | | | | | Some error values were missing from the table which meant that they could not be translated by fdt_strerror(). Signed-off-by: Benjamin Fair <b-fair@ti.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: fix fdt_stringlist_search()Masahiro Yamada2018-07-191-1/+1
| | | | | | | If fdt_getprop() fails, negative error code should be returned. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: fix fdt_stringlist_count()Masahiro Yamada2018-07-191-1/+1
| | | | | | | If fdt_getprop() fails, negative error code should be returned. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* fdt: strerr: Remove spurious BADOVERLAYMaxime Ripard2018-07-191-1/+0
| | | | | | | There's one FDT_ERR_BADOVERLAY too many in the fdt error table. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: Add BADPHANDLE error stringMaxime Ripard2018-07-191-0/+1
| | | | | | | | The BADPHANDLE error was missing a string, leading to an <unknown error> string being returned if you were to call fdt_strerror. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>