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

From: Thorsten Blum

Date: Mon May 04 2026 - 10:38:58 EST


On Mon, May 04, 2026 at 03:54:14PM +0200, Andy Shevchenko wrote:
> 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.

I just checked again, but I don't get any checkpatch warnings.

> 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?

The other one in rng_dev_read() already uses a boolean expression, hence
no changes.

Thanks,
Thorsten