diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2018-12-21 08:28:40 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-01-22 10:23:17 +0100 |
commit | 2ef8179bb7a6817de3fc9407ab55aa357f2d1e4d (patch) | |
tree | c332bc00c3006f2d0a347e1a1409c169d37d9d34 /lib/crc64.c | |
parent | ihex: Simplify next record offset calculation (diff) | |
download | linux-2ef8179bb7a6817de3fc9407ab55aa357f2d1e4d.tar.xz linux-2ef8179bb7a6817de3fc9407ab55aa357f2d1e4d.zip |
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 <cphealy@gmail.com>
Cc: Kyle McMartin <kyle@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/crc64.c')
0 files changed, 0 insertions, 0 deletions