aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek BehĂșn <[email protected]>2024-08-31 11:20:49 +0200
committerArnd Bergmann <[email protected]>2024-09-02 09:42:10 +0000
commit82944f65a0a59a44c397e3e22d592afdfb9b3074 (patch)
treee83bcd15da2e2585894f5a3d396af5a7b64d472b
parent8a4853a65b88240dc778b5d4360a2921ec6b22c8 (diff)
firmware: turris-mox-rwtm: Use ALIGN() instead of hardcoding
Use ALIGN(max, 4) instead of hardcoding ((max + 3) & ~3). Signed-off-by: Marek BehĂșn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnd Bergmann <[email protected]>
-rw-r--r--drivers/firmware/turris-mox-rwtm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/firmware/turris-mox-rwtm.c b/drivers/firmware/turris-mox-rwtm.c
index a9391705f5b4..0c7d8c96ea17 100644
--- a/drivers/firmware/turris-mox-rwtm.c
+++ b/drivers/firmware/turris-mox-rwtm.c
@@ -6,6 +6,7 @@
*/
#include <crypto/sha2.h>
+#include <linux/align.h>
#include <linux/armada-37xx-rwtm-mailbox.h>
#include <linux/completion.h>
#include <linux/container_of.h>
@@ -268,7 +269,7 @@ static int mox_hwrng_read(struct hwrng *rng, void *data, size_t max, bool wait)
msg.command = MBOX_CMD_GET_RANDOM;
msg.args[0] = 1;
msg.args[1] = rwtm->buf_phys;
- msg.args[2] = (max + 3) & ~3;
+ msg.args[2] = ALIGN(max, 4);
if (!wait) {
if (!mutex_trylock(&rwtm->busy))