]> www.infradead.org Git - users/willy/xarray.git/commit
firmware: turris-mox-rwtm: Use macro constant instead of hardcoded 4096
authorMarek BehĂșn <kabel@kernel.org>
Sat, 31 Aug 2024 09:20:35 +0000 (11:20 +0200)
committerArnd Bergmann <arnd@arndb.de>
Mon, 2 Sep 2024 09:41:56 +0000 (09:41 +0000)
commit29d258542f900a55791ec2ca8b15e4f9da083a14
tree0f9f8a97e75855953c7e79d469c55a10cb8ac82c
parent47ac09b91befbb6a235ab620c32af719f8208399
firmware: turris-mox-rwtm: Use macro constant instead of hardcoded 4096

The 4096 bytes limit in mox_hwrng_read() is due to the DMA buffer being
allocated to one PAGE_SIZE bytes. Use new local macro constant
RWTM_DMA_BUFFER_SIZE at allocation time and when used in mox_hwrng_read().

Use SZ_4K instead of PAGE_SIZE. Although PAGE_SIZE is never set to a
larger value on Armada 3720, it theoretically could, and this would be a
waste of space.

Signed-off-by: Marek BehĂșn <kabel@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20240831092050.23093-2-kabel@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
drivers/firmware/turris-mox-rwtm.c