rockchip: mkimage: simplify start/size calculation for rc4_encode
authorPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Wed, 15 Mar 2017 11:08:42 +0000 (12:08 +0100)
committerSimon Glass <sjg@chromium.org>
Wed, 5 Apr 2017 02:01:57 +0000 (20:01 -0600)
commitf3edf8b18ff6a6f5bf9893da5460449bae028430
tree73c01fdfbba7200316c75f07af29587c00a217bf
parent483a8014e98b699c9a918137f7124702b3ec29c1
rockchip: mkimage: simplify start/size calculation for rc4_encode

The RC4 encoding works on full blocks, but the calculation of the
starting offset and size are needlessly complicated by using a
reference value known to be offset into a block by the size of the
header and then correcting for the (hard-coded) size of the header
(i.e. 4 bytes).

We change this over to use the RK_SPL_HDR_START directly (which is
known to be on a block boundary).

X-AffectedPlatforms: RK3399-Q7
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tested-by: Klaus Goger <klaus.goger@theobroma-systems.com>
tools/rksd.c
tools/rkspi.c