[PATCH] crypto: ahash - use str_yes_no() helper in crypto_ahash_show()

Thorsten Blum posted 1 patch 10 months, 1 week ago
crypto/ahash.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
[PATCH] crypto: ahash - use str_yes_no() helper in crypto_ahash_show()
Posted by Thorsten Blum 10 months, 1 week ago
Remove hard-coded strings by using the str_yes_no() helper function.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 crypto/ahash.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/crypto/ahash.c b/crypto/ahash.c
index b08b89ec26ec..923c68a39ddd 100644
--- a/crypto/ahash.c
+++ b/crypto/ahash.c
@@ -21,6 +21,7 @@
 #include <linux/slab.h>
 #include <linux/seq_file.h>
 #include <linux/string.h>
+#include <linux/string_choices.h>
 #include <net/netlink.h>
 
 #include "hash.h"
@@ -536,8 +537,8 @@ static void crypto_ahash_show(struct seq_file *m, struct crypto_alg *alg)
 static void crypto_ahash_show(struct seq_file *m, struct crypto_alg *alg)
 {
 	seq_printf(m, "type         : ahash\n");
-	seq_printf(m, "async        : %s\n", alg->cra_flags & CRYPTO_ALG_ASYNC ?
-					     "yes" : "no");
+	seq_printf(m, "async        : %s\n",
+		   str_yes_no(alg->cra_flags & CRYPTO_ALG_ASYNC));
 	seq_printf(m, "blocksize    : %u\n", alg->cra_blocksize);
 	seq_printf(m, "digestsize   : %u\n",
 		   __crypto_hash_alg_common(alg)->digestsize);
-- 
2.48.0
Re: [PATCH] crypto: ahash - use str_yes_no() helper in crypto_ahash_show()
Posted by Herbert Xu 9 months, 4 weeks ago
On Mon, Feb 10, 2025 at 11:04:48AM +0100, Thorsten Blum wrote:
> Remove hard-coded strings by using the str_yes_no() helper function.
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
>  crypto/ahash.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt