Skip to contentSkip to conversation

crypto: api - Fix CRYPTO_USER checks for report function

PATCH In review Ondrej Mosnacek 2 participants 2 messages May 2, 2023 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: api - Fix CRYPTO_USER checks for report function

Checking the config via ifdef incorrectly compiles out the report functions when CRYPTO_USER is set to =m. Fix it by using IS_ENABLED() instead.

Fixes c0f9e01dd266 ("crypto: api - Check CRYPTO_USER instead of NET for report")
---
 crypto/acompress.c | 2 +-
 crypto/aead.c      | 2 +-
 crypto/ahash.c     | 2 +-
 crypto/akcipher.c  | 2 +-
 crypto/kpp.c       | 2 +-
 crypto/rng.c       | 2 +-
 crypto/scompress.c | 2 +-
 crypto/shash.c     | 2 +-
 crypto/skcipher.c  | 2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)
crypto/acompress.c +1 -1
index 82a290df2822a..1c682810a484d 100644
@@ -125,7 +125,7 @@ static const struct crypto_type crypto_acomp_type = {
 #ifdef CONFIG_PROC_FS
 	.show = crypto_acomp_show,
 #endif
-#ifdef CONFIG_CRYPTO_USER
+#if IS_ENABLED(CONFIG_CRYPTO_USER)
 	.report = crypto_acomp_report,
 #endif
 #ifdef CONFIG_CRYPTO_STATS
crypto/aead.c +1 -1
index ffc48a7dfb349..d5ba204ebdbfa 100644
@@ -242,7 +242,7 @@ static const struct crypto_type crypto_aead_type = {
 #ifdef CONFIG_PROC_FS
 	.show = crypto_aead_show,
 #endif
-#ifdef CONFIG_CRYPTO_USER
+#if IS_ENABLED(CONFIG_CRYPTO_USER)
 	.report = crypto_aead_report,
 #endif
 #ifdef CONFIG_CRYPTO_STATS
crypto/ahash.c +1 -1
index b8a607928e72d..3246510404465 100644
@@ -509,7 +509,7 @@ static const struct crypto_type crypto_ahash_type = {
 #ifdef CONFIG_PROC_FS
 	.show = crypto_ahash_show,
 #endif
-#ifdef CONFIG_CRYPTO_USER
+#if IS_ENABLED(CONFIG_CRYPTO_USER)
 	.report = crypto_ahash_report,
 #endif
 #ifdef CONFIG_CRYPTO_STATS
crypto/akcipher.c +1 -1
index 186e762b509a6..7960ceb528c36 100644
@@ -98,7 +98,7 @@ static const struct crypto_type crypto_akcipher_type = {
 #ifdef CONFIG_PROC_FS
 	.show = crypto_akcipher_show,
 #endif
-#ifdef CONFIG_CRYPTO_USER
+#if IS_ENABLED(CONFIG_CRYPTO_USER)
 	.report = crypto_akcipher_report,
 #endif
 #ifdef CONFIG_CRYPTO_STATS
crypto/kpp.c +1 -1
index 74f2e8e918fa5..33d44e59387ff 100644
@@ -96,7 +96,7 @@ static const struct crypto_type crypto_kpp_type = {
 #ifdef CONFIG_PROC_FS
 	.show = crypto_kpp_show,
 #endif
-#ifdef CONFIG_CRYPTO_USER
+#if IS_ENABLED(CONFIG_CRYPTO_USER)
 	.report = crypto_kpp_report,
 #endif
 #ifdef CONFIG_CRYPTO_STATS
crypto/rng.c +1 -1
index ffde0f64fb259..279dffdebf598 100644
@@ -118,7 +118,7 @@ static const struct crypto_type crypto_rng_type = {
 #ifdef CONFIG_PROC_FS
 	.show = crypto_rng_show,
 #endif
-#ifdef CONFIG_CRYPTO_USER
+#if IS_ENABLED(CONFIG_CRYPTO_USER)
 	.report = crypto_rng_report,
 #endif
 #ifdef CONFIG_CRYPTO_STATS
crypto/scompress.c +1 -1
index 24138b42a648a..442a82c9de7de 100644
@@ -240,7 +240,7 @@ static const struct crypto_type crypto_scomp_type = {
 #ifdef CONFIG_PROC_FS
 	.show = crypto_scomp_show,
 #endif
-#ifdef CONFIG_CRYPTO_USER
+#if IS_ENABLED(CONFIG_CRYPTO_USER)
 	.report = crypto_scomp_report,
 #endif
 #ifdef CONFIG_CRYPTO_STATS
crypto/shash.c +1 -1
index 5845b7d59b2f2..717b42df3495e 100644
@@ -548,7 +548,7 @@ static const struct crypto_type crypto_shash_type = {
 #ifdef CONFIG_PROC_FS
 	.show = crypto_shash_show,
 #endif
-#ifdef CONFIG_CRYPTO_USER
+#if IS_ENABLED(CONFIG_CRYPTO_USER)
 	.report = crypto_shash_report,
 #endif
 #ifdef CONFIG_CRYPTO_STATS
crypto/skcipher.c +1 -1
index 6caca02d7e552..7b275716cf4e3 100644
@@ -776,7 +776,7 @@ static const struct crypto_type crypto_skcipher_type = {
 #ifdef CONFIG_PROC_FS
 	.show = crypto_skcipher_show,
 #endif
-#ifdef CONFIG_CRYPTO_USER
+#if IS_ENABLED(CONFIG_CRYPTO_USER)
 	.report = crypto_skcipher_report,
 #endif
 #ifdef CONFIG_CRYPTO_STATS
Signature · 1 line
2.40.1
maintainer
#1 lore raw
Quoted 6 lines · Ondrej Mosnacek

Checking the config via ifdef incorrectly compiles out the report functions when CRYPTO_USER is set to =m. Fix it by using IS_ENABLED() instead.

Fixes c0f9e01dd266 ("crypto: api - Check CRYPTO_USER instead of NET for report")
Quoted 11 lines
---
 crypto/acompress.c | 2 +-
 crypto/aead.c      | 2 +-
 crypto/ahash.c     | 2 +-
 crypto/akcipher.c  | 2 +-
 crypto/kpp.c       | 2 +-
 crypto/rng.c       | 2 +-
 crypto/scompress.c | 2 +-
 crypto/shash.c     | 2 +-
 crypto/skcipher.c  | 2 +-
 9 files changed, 9 insertions(+), 9 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