Skip to contentSkip to conversation

crypto: fips - Use str_enabled_disabled() helper in fips_enable()

PATCH In review Thorsten Blum 2 participants 2 messages Dec 23, 2024 – Jan 4, 2025 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: fips - Use str_enabled_disabled() helper in fips_enable()

Remove hard-coded strings by using the str_enabled_disabled() helper function.

Use pr_info() instead of printk(KERN_INFO) to silence a checkpatch warning.

---
 crypto/fips.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
crypto/fips.c +2 -2
index 8a784018ebfc..a58e7750f532 100644
@@ -12,6 +12,7 @@
 #include <linux/kernel.h>
 #include <linux/sysctl.h>
 #include <linux/notifier.h>
+#include <linux/string_choices.h>
 #include <generated/utsrelease.h>
 
 int fips_enabled;
@@ -24,8 +25,7 @@ EXPORT_SYMBOL_GPL(fips_fail_notif_chain);
 static int fips_enable(char *str)
 {
 	fips_enabled = !!simple_strtol(str, NULL, 0);
-	printk(KERN_INFO "fips mode: %s\n",
-		fips_enabled ? "enabled" : "disabled");
+	pr_info("fips mode: %s\n", str_enabled_disabled(fips_enabled));
 	return 1;
 }
 
Signature · 1 line
2.47.1
maintainer
#1 lore raw
Quoted 10 lines · Thorsten Blum

Remove hard-coded strings by using the str_enabled_disabled() helper function.

Use pr_info() instead of printk(KERN_INFO) to silence a checkpatch warning.

---
 crypto/fips.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch applied. Thanks.

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