asm-generic: simplify unaligned.h
authorJens Wiklander <jens.wiklander@linaro.org>
Mon, 22 May 2023 12:22:38 +0000 (14:22 +0200)
committerTom Rini <trini@konsulko.com>
Wed, 31 May 2023 18:05:34 +0000 (14:05 -0400)
commit60f1ba7b68f25a8d6eff65928ac87fdbfb80add4
treef79172936480f220dacc9dab8bf8bebb1a80571f
parent51bcd02dceca12a5ff2c215bbae8c4ec8ac88b87
asm-generic: simplify unaligned.h

The get_unaligned()/put_unaligned() implementations are more
complex than necessary.

Move everything into one file and use a more compact implementation based
on packed struct access and byte swapping macros.

This patch is based on the Linux kernel commit 803f4e1eab7a
("asm-generic: simplify asm/unaligned.h") by Arnd Bergmann.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
include/asm-generic/unaligned.h