]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
tools: kwbimage: Fix endianity when printing kwbimage header
authorPali Rohár <pali@kernel.org>
Sun, 8 Jan 2023 12:56:42 +0000 (13:56 +0100)
committerStefan Roese <sr@denx.de>
Wed, 1 Mar 2023 05:39:17 +0000 (06:39 +0100)
All fields in kwbimage header are in little endian format.

Signed-off-by: Pali Rohár <pali@kernel.org>
tools/kwbimage.c

index 1128c934dda916693042d05797997be378d6fd1d..97be3bed79cbce5e3e3e2d22b0580e7f37c33127 100644 (file)
@@ -1928,9 +1928,9 @@ static void kwbimage_print_header(const void *ptr)
        }
 
        printf("Data Size:    ");
-       genimg_print_size(mhdr->blocksize - sizeof(uint32_t));
-       printf("Load Address: %08x\n", mhdr->destaddr);
-       printf("Entry Point:  %08x\n", mhdr->execaddr);
+       genimg_print_size(le32_to_cpu(mhdr->blocksize) - sizeof(uint32_t));
+       printf("Load Address: %08x\n", le32_to_cpu(mhdr->destaddr));
+       printf("Entry Point:  %08x\n", le32_to_cpu(mhdr->execaddr));
 }
 
 static int kwbimage_check_image_types(uint8_t type)