* [PATCH] crypto: cesa - use max to simplify mv_cesa_probe
@ 2026-05-12 13:34 Thorsten Blum
0 siblings, 0 replies; only message in thread
From: Thorsten Blum @ 2026-05-12 13:34 UTC (permalink / raw)
To: Srujana Challa, Bharat Bhushan, Herbert Xu, David S. Miller,
Rosen Penev, Thorsten Blum, Krzysztof Kozlowski
Cc: linux-crypto, linux-kernel
Use max() to simplify mv_cesa_probe() and improve its readability.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
drivers/crypto/marvell/cesa/cesa.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/crypto/marvell/cesa/cesa.c b/drivers/crypto/marvell/cesa/cesa.c
index 687ed730174d..75d8ba23d9a2 100644
--- a/drivers/crypto/marvell/cesa/cesa.c
+++ b/drivers/crypto/marvell/cesa/cesa.c
@@ -18,6 +18,7 @@
#include <linux/io.h>
#include <linux/kthread.h>
#include <linux/mbus.h>
+#include <linux/minmax.h>
#include <linux/platform_device.h>
#include <linux/scatterlist.h>
#include <linux/slab.h>
@@ -442,10 +443,8 @@ static int mv_cesa_probe(struct platform_device *pdev)
sram_size = CESA_SA_DEFAULT_SRAM_SIZE;
of_property_read_u32(cesa->dev->of_node, "marvell,crypto-sram-size",
&sram_size);
- if (sram_size < CESA_SA_MIN_SRAM_SIZE)
- sram_size = CESA_SA_MIN_SRAM_SIZE;
- cesa->sram_size = sram_size;
+ cesa->sram_size = max(sram_size, CESA_SA_MIN_SRAM_SIZE);
spin_lock_init(&cesa->lock);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-05-12 13:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-12 13:34 [PATCH] crypto: cesa - use max to simplify mv_cesa_probe Thorsten Blum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox