Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tools/firmware/ihex2fw: Simplify next record offset calculation
We can convert original expression for 'writelen" to use ALIGN as follows: (p->len + 9) & ~3 => (p->len + 6 + 3) & ~3 => ALIGN(p->len + 6, 4) Now, subsituting "p->len + 6" with "p->len + sizeof(p->addr) + sizeof(p->len)" we end up with the same expression as used by kernel couterpart in linux/ihex.h: ALIGN(p->len + sizeof(p->addr) + sizeof(p->len), 4) That is a full size of the record, aligned to 4 bytes. No functional change intended. Cc: Chris Healy <[email protected]> Cc: Kyle McMartin <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: David Woodhouse <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: linux-kernel <[email protected]> Signed-off-by: Andrey Smirnov <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
- Loading branch information