Re: [PATCH 4/4] hwrng: core - use sysfs_emit_at in rng_available_show
From: Andy Shevchenko
Date: Mon May 04 2026 - 10:04:20 EST
On Thu, Apr 30, 2026 at 01:00:51PM +0200, Thorsten Blum wrote:
> Replace strlcat() with sysfs_emit_at() in rng_available_show() and add
> 'int len' to keep track of the number of bytes written. sysfs_emit_at()
> is preferred for formatting sysfs output because it provides safer
> bounds checking.
>
> Inline mutex_lock_interruptible() and drop the now-unused local error
> variable. Remove the unnecessary 'buf' NUL initialization. Return 'len'
> directly instead of strlen(buf).
This is almost the same I came up with (but only today), hence
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
Also note, when series is more than a single patch, it's highly recommended to
have a cover letter. Some maintainers do even require that.
--
With Best Regards,
Andy Shevchenko