
If an error is returned, leave the return arguments alone. There is no point in setting them to zero, since the caller already knows (from the error code) that they are not being returned. This makes things simpler for callers which have an existing devicetree. Signed-off-by: Simon Glass <sjg@chromium.org> --- boot/image-fdt.c | 3 --- include/image.h | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/boot/image-fdt.c b/boot/image-fdt.c index fc5a3d8ff4a..6859a7c848c 100644 --- a/boot/image-fdt.c +++ b/boot/image-fdt.c @@ -444,9 +444,6 @@ int boot_get_fdt(void *buf, const char *select, uint arch, char *fdt_blob = NULL; ulong fdt_addr; - *startp = NULL; - *sizep = 0; - if (select || genimg_has_config(images)) { int ret; diff --git a/include/image.h b/include/image.h index d38320f69cb..46b91888f5b 100644 --- a/include/image.h +++ b/include/image.h @@ -895,8 +895,8 @@ int fit_get_node_from_config(struct bootm_headers *images, * @select: FDT to select (this is normally argv[2] of the bootm command) * @arch: architecture (IH_ARCH_...) * @images: pointer to the bootm images structure - * @startp: returns the fdt start address, if 0 if none - * @sizep: returns the fdt length, or 0 if none + * @startp: returns the fdt start address, on success + * @sizep: returns the fdt length, on success * * Return: 0 if fdt image was found and valid, or skipped; * 1, if fdt image is found but corrupted -- 2.43.0