summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* libfdt: Don't mask fdt_get_name() returned errorPierre-Clément Tosi2022-07-301-1/+4
| | | | | | | | | | | Return the error code from fdt_get_name() (contained in len when the result is NULL) instead of masking it with FDT_ERR_BADSTRUCTURE. Fixes: fda71da26e7f ("libfdt: Handle failed get_name() on BEGIN_NODE") Reported-by: Mike McTernan <mikemcternan@google.com> Signed-off-by: Pierre-Clément Tosi <ptosi@google.com> Message-Id: <20220729130019.804288-1-ptosi@google.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* manual.txt: Follow README.md and remove JonPierre-Clément Tosi2022-07-301-2/+1
| | | | | | | | | | | Following 0ee1d479b23a ("Remove Jon Loeliger from maintainers list"), make the "Submitting Patches" section of the manual.txt consistent with the README by requesting patches to only be sent to David. Cc: Jon Loeliger <loeliger@gmail.com> Signed-off-by: Pierre-Clément Tosi <ptosi@google.com> Message-Id: <20220729131019.806164-1-ptosi@google.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* Update README in MANIFEST.in and setup.py to README.mdSaad Waheed2022-07-302-2/+2
| | | | Signed-off-by: Saad Waheed <saad.waheed@10xengineers.ai>
* Add description of Signed-off-by linesDavid Gibson2022-07-291-0/+54
| | | | | | | | | | | | | | | dtc and libfdt have been using Signed-off-by lines (as used in the Linux kernel) for some time, like a lot of open source projects. However Uwe Kleine-König pointed out we never really stated what they mean in our context. Add information on what the S-o-b line means in CONTRIBUTING.md - this is essentially a quote of the same information from the kernel documentation, with some tweaks to make sense in the new context. Suggested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
* Split out information for contributors to CONTRIBUTING.mdDavid Gibson2022-07-282-19/+25
| | | | | | | | | README.md covers both general information for people using and building the software, and more specific information for people contributing to either dtc or libfdt. Split out the latter information into its own file for easier reference. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* Remove Jon Loeliger from maintainers listDavid Gibson2022-07-281-1/+0
| | | | | | Jon hasn't been actively working on dtc maintenance for some years. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* Convert README to README.mdDavid Gibson2022-07-282-106/+120
| | | | | | | | Let's move vaguely into the twenty-first century by converting our old plain text README file to Markdown. While we're updating the formatting, make some small polish changes to the content. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* Allow static building with mesonTero Tervala2022-07-274-5/+28
| | | | | | | | | Added "static-build" option in the meson_options.txt. Setting it to "true" allows static building. Signed-off-by: Tero Tervala <tero.tervala@unikie.com> Message-Id: <20220629163557.932298-1-tero.tervala@unikie.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* Allow static building with makeTero Tervala2022-07-273-11/+24
| | | | | | | | | Set STATIC_BUILD=1 environment variable to enable static building when using makefiles. Signed-off-by: Tero Tervala <tero.tervala@unikie.com> Message-Id: <20220629163531.932281-1-tero.tervala@unikie.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: Handle failed get_name() on BEGIN_NODEPierre-Clément Tosi2022-07-261-1/+1
| | | | | | | | | | Validate the return value of fdt_get_name() as an ill-formed DT, causing it to fail, could result in fdt_check_full() dereferencing NULL. fixes: a2def5479950 ("libfdt: Check that the root-node name is empty") Signed-off-by: Pierre-Clément Tosi <ptosi@google.com> Message-Id: <20220714083848.958492-1-ptosi@google.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* Fix test script to run also on dash shellTero Tervala2022-07-261-2/+2
| | | | | | | | | | | | | | | | | | | | /bin/sh points to dash instead of bash in some linux distros. One test would fail if dash was used, this fix will allow all tests to run properly on dash too. dash built-in printf does not support "\xNN" -hex escape format. "\NNN" -octal escape format is supported by both bash and dash printf. Replaced "$(echo "$expect")" because this actually runs /bin/echo instead of shell internal echo and in some cases causes "\NNN" escapes to be printed as the actual characters they represent instead of the escape sequence itself. Cosmetic quotes added to make printout a bit clearer. Signed-off-by: Tero Tervala <tero.tervala@unikie.com> Message-Id: <20220704073722.1075849-1-tero.tervala@unikie.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* Add missing relref_merge test to meson test listTero Tervala2022-07-021-0/+1
| | | | | | | | | Will remove one "Strange test result" when running tests with meson Signed-off-by: Tero Tervala <tero.tervala@unikie.com> Message-Id: <20220629163114.932175-1-tero.tervala@unikie.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* pylibfdt: add FdtRo.get_path()Luca Weiss2022-04-202-0/+41
| | | | | | | | | | | Add a new Python method wrapping fdt_get_path() from the C API. Also add a test for the new method. Signed-off-by: Luca Weiss <luca@z3ntu.xyz> Message-Id: <20220419194537.63170-1-luca@z3ntu.xyz> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* pylibfdt: fix swig build in installRob Herring2022-02-042-1/+8
| | | | | | | | | | | | | | A 'pip install' is silently broken unless the tree is dirty and contains pylibfdt/libfdt.py. The problem is a known issue[1] with SWIG and setuptools where the 'build_py' stage needing module.py runs before the 'build_ext' stage which generates it. The work-around is to override 'build_py' to run 'build_ext' first. [1] https://stackoverflow.com/questions/50239473/building-a-module-with-setuptools-and-swig Signed-off-by: Rob Herring <robh@kernel.org> Message-Id: <20220203180408.611645-2-robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* tests: add test cases for label-relative path referencesAhmad Fatoum2022-01-257-2/+112
| | | | | | Newly added &{label/path} feature doesn't yet have any tests. Add some. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
* dtc: introduce label relative path referencesAhmad Fatoum2022-01-253-4/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reference via label allows extending nodes with compile-time checking of whether the node being extended exists. This is useful to catch renamed/removed nodes after an update of the device trees to be extended. In absence of labels in the original device trees, new style path references can be used: /* upstream device tree */ / { leds: some-non-standard-led-controller-name { led-0 { default-state = "off"; }; }; }; /* downstream device tree */ &{/some-non-standard-led-controller-name/led-0} { default-state = "on"; }; This is a common theme within the barebox bootloader[0], which extends the upstream (Linux) device trees in that manner. The downside is that, especially for deep nodes, these references can get quite long and tend to break often due to upstream rework (e.g. rename to adhere to bindings). Often there is a label a level or two higher that could be used. This patch allows combining both a label and a new style path reference to get a compile-time-checked reference, which allows rewriting the previous downstream device tree snippet to: &{leds/led-0} { default-state = "on"; }; This won't be broken when /some-non-standard-led-controller-name is renamed or moved while keeping the label. And if led-0 is renamed, we will get the expected compile-time error. Overlay support is skipped for now as they require special support: The label and relative path parts need to be resolved at overlay apply-time, not at compile-time. [0]: https://www.barebox.org/doc/latest/devicetree/index.html Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
* util: introduce xstrndup helperAhmad Fatoum2022-01-252-0/+12
| | | | | | | We already have xstrdup, add xstrndup as well to make it straight-forward to clone part of a string. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
* setup.py: fix out of tree buildMarc-André Lureau2022-01-041-1/+1
| | | | | | | | Fixes: commit 1cc41b1c9 ("pylibfdt: Add packaging metadata") Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220103073855.1468799-3-marcandre.lureau@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* Handle integer overflow in check_property_phandle_args()David Gibson2021-12-293-6/+30
| | | | | | | | | | | | | If the corresponding '#xxx-cells' value is much too large, an integer overflow can prevent the checks in check_property_phandle_args() from correctly determining that the checked property is too short for the given cells value. This leads to an infinite loops. This patch fixes the bug, and adds a testcase for it. Further information in https://github.com/dgibson/dtc/issues/64 Reported-by: Anciety <anciety@pku.edu.cn> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* README: Explain how to add a new API functionSimon Glass2021-12-281-0/+9
| | | | | | | | This is not obvious so add a little note about it. Signed-off-by: Simon Glass <sjg@chromium.org> Message-Id: <20211107224346.3181320-2-sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* Fix a UB when fdt_get_string return nullLoveSy2021-12-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | When fdt_get_string return null, `namep` is not correctly reset. From the document of `fdt_getprop_by_offset`, the parameter `namep` will be always overwritten (that is, it will be overwritten without exception of error occurance). As for the caller (like https://github.com/topjohnwu/Magisk/blob/e097c097feb881f6097b6d1dc346f310bc92f5d6/native/jni/magiskboot/dtb.cpp#L42), the code may be like: ```cpp size_t size; const char *name; auto *value = fdt_getprop_by_offset(fdt, prop, &name, &size); ``` and if `value == nullptr`, `size` is also be overwritten correctly but `name` is not, which is quite inconsistent. This commit makes sure `name` and `size` behavior consistently (reset to reasonable value) when error occurs. Signed-off-by: LoveSy <shana@zju.edu.cn> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* tests: setprop_inplace: use xstrdup instead of unchecked strdupAhmad Fatoum2021-12-281-1/+1
| | | | | | | | | | This is the only strdup instance we have, all others are xstrdup. As strdup is _POSIX_C_SOURCE >= v200809L, which we don't require and we don't check strdup error return here, switch to xstrdup instead. This aligns the test with others that call xfuncs, mainly xmalloc(). Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* pylibfdt: add Property.as_*int*_array()Luca Weiss2021-12-283-0/+30
| | | | | | | | | | | Add new methods to handle decoding of int32, uint32, int64 and uint64 arrays. Also add tests for the new methods. Signed-off-by: Luca Weiss <luca@z3ntu.xyz> Message-Id: <20211225132558.167123-3-luca@z3ntu.xyz> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* pylibfdt: add Property.as_stringlist()Luca Weiss2021-12-282-0/+15
| | | | | | | | | | | Add a new method for decoding a string list property, useful for e.g. the "reg-names" property. Also add a test for the new method. Signed-off-by: Luca Weiss <luca@z3ntu.xyz> Message-Id: <20211225132558.167123-2-luca@z3ntu.xyz> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* Fix Python crash on getprop deallocationLuca Weiss2021-12-261-2/+4
| | | | | | | | | | | | | | | | | | | | | | | Fatal Python error: none_dealloc: deallocating None Python runtime state: finalizing (tstate=0x000055c9bac70920) Current thread 0x00007fbe34e47740 (most recent call first): <no Python frame> Aborted (core dumped) This is caused by a missing Py_INCREF on the returned Py_None, as demonstrated e.g. in https://github.com/mythosil/swig-python-incref or described at https://edcjones.tripod.com/refcount.html ("Remember to INCREF Py_None!") A PoC for triggering this crash is uploaded to https://github.com/z3ntu/pylibfdt-crash . With this patch applied to pylibfdt the crash does not happen. Signed-off-by: Luca Weiss <luca@z3ntu.xyz> Message-Id: <20211224102811.70695-1-luca@z3ntu.xyz> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* Support 'r' format for printing raw bytes with fdtgetRafał Miłecki2021-12-097-5/+18
| | | | | | | | | | | | | | | | | | | FT is sometimes used for storing raw data. That is quite common for U-Boot FIT images. Extracting such data is not trivial currently. Using type 's' (string) will replace every 0x00 (NUL) with 0x20 (space). Using type 'x' will print bytes but in xxd incompatible format. This commit adds support for 'r' (raw) format. Example usage: fdtget -t r firmware.itb /images/foo data > image.raw Support for encoding isn't added as there isn't any clean way of passing binary data as command line argument. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Message-Id: <20211209061420.29466-1-zajec5@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: overlay: make overlay_get_target() publicVikram Garhwal2021-11-183-22/+26
| | | | | | | | | | | This is done to get the target path for the overlay nodes which is very useful in many cases. For example, Xen hypervisor needs it when applying overlays because Xen needs to do further processing of the overlay nodes, e.g. mapping of resources(IRQs and IOMMUs) to other VMs, creation of SMMU pagetables, etc. Signed-off-by: Vikram Garhwal <fnu.vikram@xilinx.com> Message-Id: <1637204036-382159-2-git-send-email-fnu.vikram@xilinx.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: fix an incorrect integer promotionElvira Khabirova2021-11-171-1/+1
| | | | | | | | | | UINT32_MAX is an integer of type unsigned int. UINT32_MAX + 1 overflows unless explicitly computed as unsigned long long. This led to some invalid addresses being treated as valid. Cast UINT32_MAX to uint64_t explicitly. Signed-off-by: Elvira Khabirova <e.khabirova@omp.ru>
* pylibfdt: Add packaging metadataRob Herring2021-11-122-0/+20
| | | | | | | | | PyPI expects to have various package metadata including long description, license, and classifiers. Add them. Signed-off-by: Rob Herring <robh@kernel.org> Message-Id: <20211112041633.741598-3-robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* README: Update pylibfdt install instructionsRob Herring2021-11-121-7/+13
| | | | | | | | | | | Now that pip is supported for installs, update the install instructions to use it. Using pip over setup.py is generally recommended and simpler. Also, drop 'SETUP_PREFIX' as it doesn't exist anywhere. Signed-off-by: Rob Herring <robh@kernel.org> Message-Id: <20211112041633.741598-2-robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* pylibfdt: fix with Python 3.10Ross Burton2021-11-122-2/+3
| | | | | | | | | | | | | | | | | | | | Since Python 2.5 the argument parsing functions when parsing expressions such as s# (string plus length) expect the length to be an int or a ssize_t, depending on whether PY_SSIZE_T_CLEAN is defined or not. Python 3.8 deprecated the use of int, and with Python 3.10 this symbol must be defined and ssize_t used[1]. Define the magic symbol when building the extension, and cast the ints from the libfdt API to ssize_t as appropriate. [1] https://docs.python.org/3.10/whatsnew/3.10.html#id2 Signed-off-by: Ross Burton <ross.burton@arm.com> Message-Id: <20211111160536.2516573-1-ross.burton@arm.com> [dwg: Adjust for new location of setup.py] Tested-by: Rob Herring <robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* pylibfdt: Move setup.py to the top levelRob Herring2021-11-115-11/+24
| | | | | | | | | | | | | | | | | | | | | | | Using 'pip' and several setup.py sub-commands currently don't work with pylibfdt. The primary reason is Python packaging has opinions on the directory structure of repositories and one of those appears to be the inability to reference source files outside of setup.py's subtree. This means a sdist cannot be created with all necessary source components (i.e. libfdt headers). Moving setup.py to the top-level solves these problems. With this change. the following commands now work: Creating packages for pypi.org: ./setup.py sdist bdist_wheel Using pip for installs: pip install . pip install git+http://github.com/robherring/dtc.git@pypi-v2 Signed-off-by: Rob Herring <robh@kernel.org> Message-Id: <20211111011135.2386773-5-robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* pylibfdt: Split setup.py author name and emailRob Herring2021-11-111-1/+2
| | | | | | | | | | The 'author' field in setup.py is supposed to be just the name. The email address goes in 'author_email' field. Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Rob Herring <robh@kernel.org> Message-Id: <20211111011135.2386773-4-robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* pylibfdt: Use setuptools_scm for the versionRob Herring2021-11-113-16/+5
| | | | | | | | | | | | | | | | The DTC version in version_gen.h causes a warning with setuptools: setuptools/dist.py:501: UserWarning: The version specified ('1.6.1-g5454474d') \ is an invalid version, this may not work as expected with newer versions of \ setuptools, pip, and PyPI. Please see PEP 440 for more details. It also creates an unnecessary dependency on the rest of the build system(s). Switch to use setuptools_scm instead to get the version for pylibfdt. Signed-off-by: Rob Herring <robh@kernel.org> Message-Id: <20211111011135.2386773-3-robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* pylibfdt: Use setuptools instead of distutilsRob Herring2021-11-111-1/+1
| | | | | | | | | The use of setuptools is favored over distutils. setuptools is needed to support building Python 'wheels' and for pip support. Signed-off-by: Rob Herring <robh@kernel.org> Message-Id: <20211111011135.2386773-2-robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: Add static lib to meson buildRob Herring2021-11-111-0/+5
| | | | | | | | | | The meson build is not building the static libfdt, so add it. Signed-off-by: Rob Herring <robh@kernel.org> Message-Id: <20211111003329.2347536-1-robh@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* CI: Cirrus: bump used FreeBSD from 12.1 to 13.0Ahmad Fatoum2021-11-011-2/+2
| | | | | | | | | | | | | CI freebsd_12 job currently fails to build PRs, because of: ``` ld-elf.so.1: /usr/local/bin/bison: Undefined symbol "fread_unlocked@FBSD_1.6" ``` According to FreeBSD issue tracker[1], the proper solution is to upgrade to a supported release, so do that for our CI. [1]: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253452 Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
* checks: Add an interrupt-map checkRob Herring2021-10-215-0/+144
| | | | | | | | | | | | | | | Add a check for parsing 'interrupt-map' properties. The check primarily tests parsing 'interrupt-map' properties which depends on and the parent interrupt controller (or another map) node. Note that this does not require '#address-cells' in the interrupt-map parent, but treats missing '#address-cells' as 0 which is how the Linux kernel parses it. There's numerous cases that expect this behavior. Cc: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Rob Herring <robh@kernel.org> Message-Id: <20211015213527.2237774-1-robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* checks: Ensure '#interrupt-cells' only exists in interrupt providersRob Herring2021-10-141-4/+10
| | | | | | | | | | | | | The interrupt provider check currently checks if an interrupt provider has #interrupt-cells, but not whether #interrupt-cells is present outside of interrupt-providers. Rework the check to cover the latter case. Cc: Andre Przywara <andre.przywara@arm.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Rob Herring <robh@kernel.org> Message-Id: <20211011191245.1009682-4-robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* checks: Drop interrupt provider '#address-cells' checkRob Herring2021-10-141-5/+0
| | | | | | | | | | | '#address-cells' is only needed when parsing 'interrupt-map' properties, so remove it from the common interrupt-provider test. Cc: Andre Przywara <andre.przywara@arm.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Rob Herring <robh@kernel.org> Message-Id: <20211011191245.1009682-3-robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* checks: Make interrupt_provider check dependent on interrupts_extended_is_cellRob Herring2021-10-141-1/+1
| | | | | | | | | | If '#interrupt-cells' doesn't pass checks, no reason to run interrupt provider check. Cc: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Rob Herring <robh@kernel.org> Message-Id: <20211011191245.1009682-1-robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* treesource: Maintain phandle label/path on outputRob Herring2021-10-113-6/+25
| | | | | | | | | | | The dts output will just output phandle integer values, but often the necessary markers are present with path or label references. Improve the output and maintain phandle label or path references when present in dts output. Signed-off-by: Rob Herring <robh@kernel.org> Message-Id: <20210727183023.3212077-6-robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* flattree: Use '\n', not ';' to separate asm pseudo-opsDavid Gibson2021-09-271-1/+2
| | | | | | | | | | | | The output of -Oasm is peculiar for assembler in that we want its output to be portable across targets (it consists entirely of pseudo-ops and labels, no actual instructions). It turns out that while ';' is a valid instruction/pseudo-op separator on most targets, it's not correct for all of them - e.g. HP PA-RISC. So, switch to using an actual \n instead. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* asm: Use assembler macros instead of cpp macrosDavid Gibson2021-09-271-194/+207
| | | | | | | | | | | | | | | | tests/trees.S is a weird thing: a portable aseembler file, used to produce a specific binary output. Currently it uses CPP macros quite heavily to construct the dtbs we want (including some partial and broken trees). Using cpp has the side effect that we need to use ; separators between instructions (or, rather, pseudo-ops), because cpp won't expand newlines. However, it turns out that while ; is a suitable separator on most targets, it doesn't work for all of them (e.g. HP PA-RISC). Switch to using the assembler's inbuilt macros rather than CPP, so that we can use genuine newlines. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* asm: Use .asciz and .ascii instead of .stringRob Herring2021-09-256-77/+75
| | | | | | | | | | | | | We use the .string pseudo-op both in some of our test assembly files and in our -Oasm output. We expect this to emit a \0 terminated string into the .o file. However for certain targets (e.g. HP PA-RISC) it doesn't include the \0. Use .asciz instead, which explicitly does what we want. There's also one place we can use .ascii (which explicitly emits a string *without* \0 termination) instead of multiple .byte directives. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* fdtdump: fix -Werror=int-to-pointer-castMarc-André Lureau2021-08-261-1/+1
| | | | | | | | | | With mingw64-gcc, the compiler complains with various warnings: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210825121350.213551-1-marcandre.lureau@redhat.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: Add ALIGNMENT error stringGeorg Kotheimer2021-08-021-0/+1
| | | | | | | | The ALIGNMENT error was missing a string, leading to <unknown error> being returned. Signed-off-by: Georg Kotheimer <georg.kotheimer@kernkonzept.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* checks: Fix bus-range checkThierry Reding2021-06-301-1/+1
| | | | | | | | | The upper limit of the bus-range is specified by the second cell of the bus-range property. Signed-off-by: Thierry Reding <treding@nvidia.com> Message-Id: <20210629114304.2451114-1-thierry.reding@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* Makefile: add -Wsign-compare to warning optionsAndre Przywara2021-06-211-1/+1
| | | | | | | | | Now that all signedness comparison warnings in the source tree have been fixed, let's enable the warning option, to avoid them creeping in again. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Message-Id: <20210618172030.9684-6-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* checks: Fix signedness comparisons warningsAndre Przywara2021-06-211-10/+10
| | | | | | | | | | | | | With -Wsign-compare, compilers warn about a mismatching signedness in comparisons in various parts in checks.c. Fix those by making all affected variables unsigned. This covers return values of the (unsigned) size_t type, phandles, variables holding sizes in general and loop counters only ever counting positives values. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Message-Id: <20210618172030.9684-5-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>