Re: [PATCH] crypto: rng - Combine two seq_printf() calls into one in crypto_rng_show()

From: Herbert Xu

Date: Tue Nov 18 2025 - 23:45:49 EST


On Mon, Nov 10, 2025 at 04:56:10PM +0100, Markus Elfring wrote:
> From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
> Date: Mon, 10 Nov 2025 16:45:13 +0100
>
> A bit of data was put into a sequence by two separate function calls.
> Print the same data by a single function call instead.
>
> Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
> ---
> crypto/rng.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/crypto/rng.c b/crypto/rng.c
> index ee1768c5a400..479c4ac6fb6c 100644
> --- a/crypto/rng.c
> +++ b/crypto/rng.c
> @@ -81,8 +81,7 @@ static void crypto_rng_show(struct seq_file *m, struct crypto_alg *alg)
> __maybe_unused;
> static void crypto_rng_show(struct seq_file *m, struct crypto_alg *alg)
> {
> - seq_printf(m, "type : rng\n");
> - seq_printf(m, "seedsize : %u\n", seedsize(alg));
> + seq_printf(m, "type : rng\nseedsize : %u\n", seedsize(alg));

This makes the code look worse and appears to be an optimisation
that isn't really needed.

Cheers,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt