crypto: rng - Combine two seq_printf() calls into one in crypto_rng_show()
PATCH 1/1 crypto: rng - Combine two seq_printf() calls into one in crypto_rng_show()
From: Markus Elfring <[email protected]>
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.
--- crypto/rng.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
crypto/rng.c +1 -2
@@ -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)); }static const struct crypto_type crypto_rng_type = {
Signature · 1 line
2.51.1
Herbert Xu
maintainerQuoted 16 lines · Markus Elfring
From: Markus Elfring <[email protected]>
Date: Mon, 10 Nov 2025 16:45:13 +0100A 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 <[email protected]>--- crypto/rng.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)crypto/rng.c +0
-0
crypto/rng.c static void crypto_rng_show(struct seq_file *m, struct crypto_alg *alg) · line 84
Quoted 6 lines
crypto/rng.c +1
-2@@ -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,
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
…>> +++ b/crypto/rng.c
Quoted 10 lines
crypto/rng.c static void crypto_rng_show(struct seq_file *m, struct crypto_alg *alg) · line 84
Quoted 7 lines
crypto/rng.c +1
-2@@ -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.
Would you expect to specify still two string literals at such a source code place?
Regards,
Markus