From: Thorsten Blum Date: Tue, 12 May 2026 13:34:15 +0000 (+0200) Subject: crypto: cesa - use max to simplify mv_cesa_probe X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=209466c5fe352b81b9fa9d135bbffbac18350fb2;p=thirdparty%2Fkernel%2Flinux.git crypto: cesa - use max to simplify mv_cesa_probe Use max() to simplify mv_cesa_probe() and improve its readability. Signed-off-by: Thorsten Blum Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/marvell/cesa/cesa.c b/drivers/crypto/marvell/cesa/cesa.c index 687ed730174d7..75d8ba23d9a2b 100644 --- a/drivers/crypto/marvell/cesa/cesa.c +++ b/drivers/crypto/marvell/cesa/cesa.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -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);