tools: kwboot: Simplify code for aligning image header
authorPali Rohár <pali@kernel.org>
Mon, 25 Oct 2021 13:13:00 +0000 (15:13 +0200)
committerStefan Roese <sr@denx.de>
Wed, 3 Nov 2021 05:45:27 +0000 (06:45 +0100)
commited792c2938331a68f4b271a6d4d0250057449608
treedbfe4522ac67a37a07863b1daf819103bdb37ffd
parent8e2e7ca1fe3a822aec31b4672b4615c07afa89c0
tools: kwboot: Simplify code for aligning image header

Expression (hdrsz % KWBOOT_XM_BLKSZ) is non-zero therefore expression
(KWBOOT_XM_BLKSZ - hdrsz % KWBOOT_XM_BLKSZ) is always less than value
KWBOOT_XM_BLKSZ. So there is no need to add another modulo. Also rename
variable `offset` to `grow` which better describes what is stored in
this variable.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
tools/kwboot.c