Re: [PATCH 2/4] hwrng: core - use bool for wait parameter in rng_get_data

From: Andy Shevchenko

Date: Mon May 04 2026 - 09:54:32 EST


On Thu, Apr 30, 2026 at 01:00:49PM +0200, Thorsten Blum wrote:
> The 'wait' parameter in rng_get_data() is a boolean flag - use bool
> instead of int to better reflect its actual type.

...

> static inline int rng_get_data(struct hwrng *rng, u8 *buffer, size_t size,
> - int wait) {
> + bool wait) {

You want to fix the checkpatch warnings while at it and indentation.

static inline int rng_get_data(struct hwrng *rng, u8 *buffer, size_t size,
bool wait)
{

...

> - rc = rng_get_data(rng, rng_fillbuf,
> - rng_buffer_size(), 1);
> + rc = rng_get_data(rng, rng_fillbuf, rng_buffer_size(), true);

Is it the only user? Why parameter is needed at all?

--
With Best Regards,
Andy Shevchenko