rockchip: mkimage: simplify start/size calculation for rc4_encode
[oweals/u-boot.git] / tools / rkspi.c
index 0271d2e817bfa0e1d543b4b3c414b4351568238e..9fa43e8303468552153dd9b8234c838ac1a3d4c4 100644 (file)
@@ -49,8 +49,8 @@ static void rkspi_set_header(void *buf, struct stat *sbuf, int ifd,
               RK_SPL_HDR_SIZE);
 
        if (rkcommon_need_rc4_spl(params))
-               rkcommon_rc4_encode_spl(buf, RK_SPL_START - 4,
-                                       params->file_size - RK_SPL_START + 4);
+               rkcommon_rc4_encode_spl(buf, RK_SPL_HDR_START,
+                                       params->file_size - RK_SPL_HDR_START);
 
        /*
         * Spread the image out so we only use the first 2KB of each 4KB