[PATCH v2 3/4] hwrng: core - use MAX to simplify RNG_BUFFER_SIZE
From: Thorsten Blum
Date: Tue May 05 2026 - 05:49:24 EST
Replace the open-coded variant with MAX().
Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>
---
Drop the explicit include as suggested by Herbert.
---
drivers/char/hw_random/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
index 870e77c9ec20..26c46cd90a83 100644
--- a/drivers/char/hw_random/core.c
+++ b/drivers/char/hw_random/core.c
@@ -30,7 +30,7 @@
#define RNG_MODULE_NAME "hw_random"
-#define RNG_BUFFER_SIZE (SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES)
+#define RNG_BUFFER_SIZE MAX(32, SMP_CACHE_BYTES)
static struct hwrng __rcu *current_rng;
/* the current rng has been explicitly chosen by user via sysfs */