Commit 2f0877c7f4fa53ba4aedf2333908057a3f6ac413
Committed by
Tom Rini
1 parent
50c2a91b67
Exists in
master
and in
53 other branches
FIT: delete unnecessary casts
Becuase fdt_check_header function takes (const void *) type argument, the argument should be passed to it without being casted to (char *). Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Showing 4 changed files with 4 additions and 8 deletions Side-by-side Diff
common/image-fdt.c
common/image-fit.c
... | ... | @@ -1596,7 +1596,7 @@ |
1596 | 1596 | len = (ulong)size; |
1597 | 1597 | |
1598 | 1598 | /* verify that image data is a proper FDT blob */ |
1599 | - if (image_type == IH_TYPE_FLATDT && fdt_check_header((char *)buf)) { | |
1599 | + if (image_type == IH_TYPE_FLATDT && fdt_check_header(buf)) { | |
1600 | 1600 | puts("Subimage data is not a FDT"); |
1601 | 1601 | return -ENOEXEC; |
1602 | 1602 | } |
common/image.c
... | ... | @@ -652,17 +652,13 @@ |
652 | 652 | { |
653 | 653 | ulong format = IMAGE_FORMAT_INVALID; |
654 | 654 | const image_header_t *hdr; |
655 | -#if defined(CONFIG_FIT) || defined(CONFIG_OF_LIBFDT) | |
656 | - char *fit_hdr; | |
657 | -#endif | |
658 | 655 | |
659 | 656 | hdr = (const image_header_t *)img_addr; |
660 | 657 | if (image_check_magic(hdr)) |
661 | 658 | format = IMAGE_FORMAT_LEGACY; |
662 | 659 | #if defined(CONFIG_FIT) || defined(CONFIG_OF_LIBFDT) |
663 | 660 | else { |
664 | - fit_hdr = (char *)img_addr; | |
665 | - if (fdt_check_header(fit_hdr) == 0) | |
661 | + if (fdt_check_header(img_addr) == 0) | |
666 | 662 | format = IMAGE_FORMAT_FIT; |
667 | 663 | } |
668 | 664 | #endif |
tools/fit_image.c