]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
hwrng: core - use bool for wait parameter in rng_get_data
authorThorsten Blum <thorsten.blum@linux.dev>
Tue, 5 May 2026 09:45:56 +0000 (11:45 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 15 May 2026 10:08:37 +0000 (18:08 +0800)
The wait parameter in rng_get_data() is a boolean flag - use bool
instead of int to better reflect its actual type.

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

index 68add1a97f31d0eddb7298898ff4172d6aaae321..870e77c9ec2071988fb955e25dee880c84a1bac7 100644 (file)
@@ -210,8 +210,8 @@ static int rng_dev_open(struct inode *inode, struct file *filp)
        return 0;
 }
 
-static inline int rng_get_data(struct hwrng *rng, u8 *buffer, size_t size,
-                       int wait) {
+static inline int rng_get_data(struct hwrng *rng, u8 *buffer, size_t size, bool wait)
+{
        int present;
 
        BUG_ON(!mutex_is_locked(&reading_mutex));
@@ -534,8 +534,7 @@ static int hwrng_fillfn(void *unused)
                }
 
                mutex_lock(&reading_mutex);
-               rc = rng_get_data(rng, rng_fillbuf,
-                                 rng_buffer_size(), 1);
+               rc = rng_get_data(rng, rng_fillbuf, rng_buffer_size(), true);
                if (current_quality != rng->quality)
                        rng->quality = current_quality; /* obsolete */
                quality = rng->quality;