diff mbox series

[9/10] crypto: api - Move MODULE_ALIAS_CRYPTO to algapi.h

Message ID E1pSE2W-00BVm0-2d@formenos.hmeau.com (mailing list archive)
State Superseded
Delegated to: Herbert Xu
Headers show
Series crypto: api - Restructure stats code | expand

Commit Message

Herbert Xu Feb. 15, 2023, 9:25 a.m. UTC
This is part of the low-level API and should not be exposed to
top-level Crypto API users.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---

 include/crypto/algapi.h |   13 +++++++++++++
 include/linux/crypto.h  |   13 -------------
 2 files changed, 13 insertions(+), 13 deletions(-)

Comments

Eric Biggers Feb. 16, 2023, 5:17 a.m. UTC | #1
On Wed, Feb 15, 2023 at 05:25:24PM +0800, Herbert Xu wrote:
> This is part of the low-level API and should not be exposed to
> top-level Crypto API users.
> 
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
> ---
> 
>  include/crypto/algapi.h |   13 +++++++++++++
>  include/linux/crypto.h  |   13 -------------
>  2 files changed, 13 insertions(+), 13 deletions(-)

For this to work, drivers/crypto/qat/qat_common/adf_ctl_drv.c needs to include
<crypto/algapi.h>.

There could be others too.

- Eric
Herbert Xu Feb. 16, 2023, 5:18 a.m. UTC | #2
On Wed, Feb 15, 2023 at 09:17:36PM -0800, Eric Biggers wrote:
>
> For this to work, drivers/crypto/qat/qat_common/adf_ctl_drv.c needs to include
> <crypto/algapi.h>.

https://patchwork.kernel.org/project/linux-crypto/patch/Y+yZHiWPKyyR6fLw@gondor.apana.org.au/

> There could be others too.

I grepped and couldn't find any others.

Thanks,
diff mbox series

Patch

diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h
index dcc1fd4ef1b4..e28957993b56 100644
--- a/include/crypto/algapi.h
+++ b/include/crypto/algapi.h
@@ -34,6 +34,19 @@ 
 
 #define CRYPTO_DMA_PADDING ((CRYPTO_DMA_ALIGN - 1) & ~(CRYPTO_MINALIGN - 1))
 
+/*
+ * Autoloaded crypto modules should only use a prefixed name to avoid allowing
+ * arbitrary modules to be loaded. Loading from userspace may still need the
+ * unprefixed names, so retains those aliases as well.
+ * This uses __MODULE_INFO directly instead of MODULE_ALIAS because pre-4.3
+ * gcc (e.g. avr32 toolchain) uses __LINE__ for uniqueness, and this macro
+ * expands twice on the same line. Instead, use a separate base name for the
+ * alias.
+ */
+#define MODULE_ALIAS_CRYPTO(name)	\
+		__MODULE_INFO(alias, alias_userspace, name);	\
+		__MODULE_INFO(alias, alias_crypto, "crypto-" name)
+
 struct crypto_aead;
 struct crypto_instance;
 struct module;
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index c26e59bb7bca..d57597ebef6e 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -20,19 +20,6 @@ 
 #include <linux/slab.h>
 #include <linux/completion.h>
 
-/*
- * Autoloaded crypto modules should only use a prefixed name to avoid allowing
- * arbitrary modules to be loaded. Loading from userspace may still need the
- * unprefixed names, so retains those aliases as well.
- * This uses __MODULE_INFO directly instead of MODULE_ALIAS because pre-4.3
- * gcc (e.g. avr32 toolchain) uses __LINE__ for uniqueness, and this macro
- * expands twice on the same line. Instead, use a separate base name for the
- * alias.
- */
-#define MODULE_ALIAS_CRYPTO(name)	\
-		__MODULE_INFO(alias, alias_userspace, name);	\
-		__MODULE_INFO(alias, alias_crypto, "crypto-" name)
-
 /*
  * Algorithm masks and types.
  */