]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
crypto: cesa - use max to simplify mv_cesa_probe
authorThorsten Blum <thorsten.blum@linux.dev>
Tue, 12 May 2026 13:34:15 +0000 (15:34 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 22 May 2026 12:25:28 +0000 (20:25 +0800)
Use max() to simplify mv_cesa_probe() and improve its readability.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/marvell/cesa/cesa.c

index 687ed730174d793354f617c99ca27f0c8083d4c5..75d8ba23d9a2bea53b9b6a9d7ca765159107757a 100644 (file)
@@ -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);