projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8a4853a
)
firmware: turris-mox-rwtm: Use ALIGN() instead of hardcoding
author
Marek Behún
<kabel@kernel.org>
Sat, 31 Aug 2024 09:20:49 +0000
(11:20 +0200)
committer
Arnd Bergmann
<arnd@arndb.de>
Mon, 2 Sep 2024 09:42:10 +0000
(09:42 +0000)
Use ALIGN(max, 4) instead of hardcoding ((max + 3) & ~3).
Signed-off-by: Marek Behún <kabel@kernel.org>
Link:
https://lore.kernel.org/r/20240831092050.23093-16-kabel@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
drivers/firmware/turris-mox-rwtm.c
patch
|
blob
|
history
diff --git
a/drivers/firmware/turris-mox-rwtm.c
b/drivers/firmware/turris-mox-rwtm.c
index
a939170
..
0c7d8c9
100644
(file)
--- 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))