[PATCH master 12/13] hw_random: fix compilation with 64-bit size_t

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



max has the type size_t, while data_size is a u32.
This doesn't matter for 32-bit OMAP, but has min() trigger a compile
error when compile testing for 64-bit. Add a cast via min_t to fix this.

Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
 drivers/hw_random/omap-rng.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hw_random/omap-rng.c b/drivers/hw_random/omap-rng.c
index 9fa50bc8e7a9..6b69994aad0b 100644
--- a/drivers/hw_random/omap-rng.c
+++ b/drivers/hw_random/omap-rng.c
@@ -190,7 +190,7 @@ static int omap_rng_do_read(struct hwrng *rng, void *data, size_t max,
 	if (!present)
 		return 0;
 
-	max = min(max, priv->pdata->data_size);
+	max = min_t(size_t, max, priv->pdata->data_size);
 
 	memcpy_fromio(data, priv->base + priv->pdata->regs[RNG_OUTPUT_0_REG], max);
 
-- 
2.39.5





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux