diff --git a/fdtextract.c b/fdtextract.c index b00a51487c2d187b115a579748fe798d18c09617..1b0150efd9bfa385eba0ae0ccceb89225e949a86 100644 --- a/fdtextract.c +++ b/fdtextract.c @@ -101,7 +101,7 @@ static int extract_image(char *buf, char *name, char *out) return -1; } - printf("Extracting: %s to %s.\n", name, out); + printf("Extracting %s to %s.\n", name, out); /* Get offset of image. Try both relative and absolute offset. */ val = fdt_getprop(buf, noffset, "data-offset", NULL); @@ -112,15 +112,13 @@ static int extract_image(char *buf, char *name, char *out) } else { /* Absolute offset */ val = fdt_getprop(buf, noffset, "data-position", NULL); + if (!val) { + printf("Error: could get offset of image: %s.\n", name); + return -1; + } + data_offset = fdt32_to_cpu(*val); } - if (!val) { - printf("Error: could get offset of image: %s.\n", name); - return -1; - } - - data_offset = fdt32_to_cpu(*val); - /* Size */ val = fdt_getprop(buf, noffset, "data-size", NULL); if (!val) { @@ -129,7 +127,6 @@ static int extract_image(char *buf, char *name, char *out) } data_size = fdt32_to_cpu(*val); - printf("Offset:0x%08x Size:0x%08x\n", data_offset, data_size); fd = open(out, O_WRONLY | O_CREAT | O_TRUNC, 0666); if (fd < 0) {