Skip to contentSkip to conversation

crypto: cesa - use max to simplify mv_cesa_probe

PATCH In review Thorsten Blum 2 participants 2 messages May 12 – May 22

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: cesa - use max to simplify mv_cesa_probe

Use max() to simplify mv_cesa_probe() and improve its readability.

---
 drivers/crypto/marvell/cesa/cesa.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/crypto/marvell/cesa/cesa.c +2 -3
index 687ed730174d..75d8ba23d9a2 100644
@@ -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);
 
maintainer
#1 lore raw
Quoted 6 lines · Thorsten Blum

Use max() to simplify mv_cesa_probe() and improve its readability.

---
 drivers/crypto/marvell/cesa/cesa.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt