diff options
author | Miquel Raynal | 2020-03-18 17:22:55 +0100 |
---|---|---|
committer | Kever Yang | 2020-03-26 22:58:46 +0800 |
commit | e5a405583f5ce9576c5084a178622e2fdd49cb23 (patch) | |
tree | 3fc81c10c5ec981831bf46e4e5bf17c1039a1c78 /tools/rkcommon.c | |
parent | 99f946976e185f9c4d94edce6bb123c9c341913a (diff) |
rockchip: mkimage: Use an existing macro instead of a decimal value
Depending on the SoC, a header of four characters is prepended to the
image. There is already a macro defining the number of characters:
RK_SPL_HDR_SIZE, so use it instead of hardcoding "4".
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Diffstat (limited to 'tools/rkcommon.c')
-rw-r--r-- | tools/rkcommon.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/rkcommon.c b/tools/rkcommon.c index c2382dfe5a1..8f281f5901a 100644 --- a/tools/rkcommon.c +++ b/tools/rkcommon.c @@ -307,11 +307,13 @@ static int rkcommon_parse_header(const void *buf, struct header0_info *header0, rkcommon_offset_to_spi(hdr1_offset)); for (i = 0; i < ARRAY_SIZE(spl_infos); i++) { - if (!memcmp(&hdr1_sdmmc->magic, spl_infos[i].spl_hdr, 4)) { + if (!memcmp(&hdr1_sdmmc->magic, spl_infos[i].spl_hdr, + RK_SPL_HDR_SIZE)) { if (spl_info) *spl_info = &spl_infos[i]; return IH_TYPE_RKSD; - } else if (!memcmp(&hdr1_spi->magic, spl_infos[i].spl_hdr, 4)) { + } else if (!memcmp(&hdr1_spi->magic, spl_infos[i].spl_hdr, + RK_SPL_HDR_SIZE)) { if (spl_info) *spl_info = &spl_infos[i]; return IH_TYPE_RKSPI; |