Commit e5a40558 authored by Miquel Raynal's avatar Miquel Raynal Committed by Kever Yang
Browse files

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: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Kever Yang's avatarKever Yang <kever.yang@rock-chips.com>
parent 99f94697
...@@ -307,11 +307,13 @@ static int rkcommon_parse_header(const void *buf, struct header0_info *header0, ...@@ -307,11 +307,13 @@ static int rkcommon_parse_header(const void *buf, struct header0_info *header0,
rkcommon_offset_to_spi(hdr1_offset)); rkcommon_offset_to_spi(hdr1_offset));
for (i = 0; i < ARRAY_SIZE(spl_infos); i++) { 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) if (spl_info)
*spl_info = &spl_infos[i]; *spl_info = &spl_infos[i];
return IH_TYPE_RKSD; 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) if (spl_info)
*spl_info = &spl_infos[i]; *spl_info = &spl_infos[i];
return IH_TYPE_RKSPI; return IH_TYPE_RKSPI;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment