Re: [PATCH 2/4] hwrng: core - use bool for wait parameter in rng_get_data
From: Andy Shevchenko
Date: Mon May 04 2026 - 10:48:27 EST
On Mon, May 04, 2026 at 04:37:17PM +0200, Thorsten Blum wrote:
> 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:
...
> > > 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.
Hmm... I remember for sure that checkpatch warns when it's a { on the line of
the prototype... Maybe it's about different scenario. Whatever, the coding
style is to have { on the new line.
...
> > > - 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.
Good, thanks for clarification.
--
With Best Regards,
Andy Shevchenko