19 Jun, 2018
2 commits
-
The current code might succeed on the first allocation and fail on the
second. Separate the checks to avoid this problem.Of course, free() will never fail and the chances that (when allocating
two small areas) one will succeed and one will fail are just as remote.
But this keeps coverity happy.Reported-by: Coverity (CID: 131226)
Signed-off-by: Simon Glass
-
This loop never actually exits, but the way the code is written this is
not obvious. Add an explicit error check.Reported-by: Coverity (CID: 131280)
Signed-off-by: Simon Glass
[trini: Add explicit init of region to NULL per LLVM warning]
Signed-off-by: Tom Rini
07 May, 2018
1 commit
-
When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.Signed-off-by: Tom Rini
29 Jan, 2018
2 commits
-
Several host-tools use "bool" type without including .
This relies on the crappy header inclusion chain.tools/Makefile has the following line:
HOST_EXTRACFLAGS += -include $(srctree)/include/libfdt_env.h \
All host-tools are forced to include libfdt_env.h even if they are
totally unrelated to FDT. Then, is indirectly included
as follows:include/libfdt_env.h
-> include/linux/types.h
->I am fixing this horrible crap. In advance, I need to add necessary
include directives explicitly. tools/fdtgrep.c needs more;
for open() and for errno.Signed-off-by: Masahiro Yamada
Reviewed-by: Joe Hershberger
Reviewed-by: Simon Glass -
The only difference between scripts/dtc/libfdt/fdt_rw.c and
lib/libfdt/fdt_rw.c is fdt_remove_unused_strings().It is only used by fdtgrep, so we do not need to compile it for U-Boot
image. Move it to tools/libfdt/fdw_rw.c so that lib/libfdt/fdt_rw.c
can be a wrapper of scripts/dtc/libfdt/fdt_rw.c.Signed-off-by: Masahiro Yamada
Reviewed-by: Simon Glass
06 Nov, 2017
1 commit
-
U-Boot bundles a patched copy of libfdt, so it's wrong to attempt to
include it . This breaks the build for me when I have dtc
fully installed in my host -- as happened earlier tonight with
Buildroot, for example.There are several other occurrences throughout the code where ' include style is being used -- IMHO wrongly.
Signed-off-by: Jan Kundrát
12 Jun, 2017
1 commit
-
Since the parameter can be NULL we must be careful not to dereference it
in this case.Signed-off-by: Simon Glass
Reported-by: Coverity (CID: 163250)
Fixes: 1043d0a0 (fdt: Add fdtgrep tool)
14 Apr, 2017
1 commit
-
With skeleton.dtsi being dropped it is more likely that the /aliases node
will be last in the device tree. Update fdtgrep to handle this.Signed-off-by: Simon Glass
Tested-by: Masahiro Yamada
07 Oct, 2016
1 commit
-
Fix various misspellings of:
* deprecated
* partition
* preceding,preceded
* preparation
* its versus it's
* export
* existing
* scenario
* redundant
* remaining
* value
* architectureSigned-off-by: Robert P. J. Day
Reviewed-by: Jagan Teki
Reviewed-by: Stefan Roese
15 Mar, 2016
1 commit
-
This tool requires that the aliases node be the first node in the tree. But
when it is not, it does not handle things gracefully. In fact it crashes.Fix this, and add a more helpful error message.
Signed-off-by: Simon Glass
Reported-by: Masahiro Yamada
04 Nov, 2015
1 commit
-
We don't need to allocate a new region list when we run out of space.
The outer function can take care of this for us.Signed-off-by: Simon Glass
Signed-off-by: Michal Simek
22 Jul, 2015
1 commit
-
This tool allows us to extract subsets of a device tree file. It is used by
the SPL vuild, which needs to cut down the device tree size for use in
limited memory.This tool was originally written for libfdt but it has not been accepted
upstream, so for now, include it in U-Boot. Several utilfdt library
functions been included inline here.If fdtgrep is eventually accepted in libfdt then we can bring that version
of libfdt in here, and drop fdtgrep (requiring that fdtgrep is provided by
the user).If it is not accepted then another approach would be to write a special
tool for chopping down device tree files for SPL. While it would use the
same libfdt support, it would be less code than fdtgrep.c because it would
not have general-purpose functions.Another approach (which was used with v1 of this series) is to sprinkler all
the device tree files with #ifdef. I don't like that idea.Signed-off-by: Simon Glass