linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crypto: caam - avoid option aliasing with the CONFIG_CAAM_QI build option
@ 2025-07-01 11:20 Lukas Bulwahn
  2025-07-02  7:38 ` Horia Geanta
  2025-07-18 10:57 ` Herbert Xu
  0 siblings, 2 replies; 3+ messages in thread
From: Lukas Bulwahn @ 2025-07-01 11:20 UTC (permalink / raw)
  To: Horia Geantă, Pankaj Gupta, Gaurav Jain, Herbert Xu,
	David S . Miller, linux-crypto
  Cc: kernel-janitors, linux-kernel, Lukas Bulwahn

From: Lukas Bulwahn <lukas.bulwahn@redhat.com>

In the Makefile, the new build option CONFIG_CAAM_QI is defined conditioned
on the existence of the CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI, which is
properly defined in the Kconfig file. So, CONFIG_CAAM_QI is just a local
alias for CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI.

There is little benefit in the source code of having this slightly shorter
alias for this configuration, but it complicates further maintenance, as
searching for the impact of CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI
requires to grep once, and then identify the option introduced and continue
searching for that. Further, tools, such as cross referencers, and scripts
to check Kconfig definitions and their use simply do not handle this
situation. Given that this is the only incidence of such a config alias in
the whole kernel tree, just prefer to avoid this pattern of aliasing here.

Use CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI throughout the Freescale
CAAM-Multicore platform driver backend source code.

No functional change.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@redhat.com>
---
 drivers/crypto/caam/Makefile  | 4 ----
 drivers/crypto/caam/ctrl.c    | 6 +++---
 drivers/crypto/caam/debugfs.c | 2 +-
 drivers/crypto/caam/debugfs.h | 2 +-
 drivers/crypto/caam/intern.h  | 4 ++--
 5 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/crypto/caam/Makefile b/drivers/crypto/caam/Makefile
index acf1b197eb84..d2eaf5205b1c 100644
--- a/drivers/crypto/caam/Makefile
+++ b/drivers/crypto/caam/Makefile
@@ -25,10 +25,6 @@ caam_jr-$(CONFIG_CRYPTO_DEV_FSL_CAAM_PKC_API) += caampkc.o pkc_desc.o
 caam_jr-$(CONFIG_CRYPTO_DEV_FSL_CAAM_BLOB_GEN) += blob_gen.o
 
 caam-$(CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI) += qi.o
-ifneq ($(CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI),)
-	ccflags-y += -DCONFIG_CAAM_QI
-endif
-
 caam-$(CONFIG_DEBUG_FS) += debugfs.o
 
 obj-$(CONFIG_CRYPTO_DEV_FSL_DPAA2_CAAM) += dpaa2_caam.o
diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c
index ce7b99019537..a93be395c878 100644
--- a/drivers/crypto/caam/ctrl.c
+++ b/drivers/crypto/caam/ctrl.c
@@ -24,7 +24,7 @@
 bool caam_dpaa2;
 EXPORT_SYMBOL(caam_dpaa2);
 
-#ifdef CONFIG_CAAM_QI
+#ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI
 #include "qi.h"
 #endif
 
@@ -968,7 +968,7 @@ static int caam_probe(struct platform_device *pdev)
 	caam_dpaa2 = !!(comp_params & CTPR_MS_DPAA2);
 	ctrlpriv->qi_present = !!(comp_params & CTPR_MS_QI_MASK);
 
-#ifdef CONFIG_CAAM_QI
+#ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI
 	/* If (DPAA 1.x) QI present, check whether dependencies are available */
 	if (ctrlpriv->qi_present && !caam_dpaa2) {
 		ret = qman_is_probed();
@@ -1099,7 +1099,7 @@ static int caam_probe(struct platform_device *pdev)
 		wr_reg32(&ctrlpriv->qi->qi_control_lo, QICTL_DQEN);
 
 		/* If QMAN driver is present, init CAAM-QI backend */
-#ifdef CONFIG_CAAM_QI
+#ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI
 		ret = caam_qi_init(pdev);
 		if (ret)
 			dev_err(dev, "caam qi i/f init failed: %d\n", ret);
diff --git a/drivers/crypto/caam/debugfs.c b/drivers/crypto/caam/debugfs.c
index 6358d3cabf57..718352b7afb5 100644
--- a/drivers/crypto/caam/debugfs.c
+++ b/drivers/crypto/caam/debugfs.c
@@ -22,7 +22,7 @@ static int caam_debugfs_u32_get(void *data, u64 *val)
 DEFINE_DEBUGFS_ATTRIBUTE(caam_fops_u32_ro, caam_debugfs_u32_get, NULL, "%llu\n");
 DEFINE_DEBUGFS_ATTRIBUTE(caam_fops_u64_ro, caam_debugfs_u64_get, NULL, "%llu\n");
 
-#ifdef CONFIG_CAAM_QI
+#ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI
 /*
  * This is a counter for the number of times the congestion group (where all
  * the request and response queueus are) reached congestion. Incremented
diff --git a/drivers/crypto/caam/debugfs.h b/drivers/crypto/caam/debugfs.h
index 8b5d1acd21a7..ef238c71f92a 100644
--- a/drivers/crypto/caam/debugfs.h
+++ b/drivers/crypto/caam/debugfs.h
@@ -18,7 +18,7 @@ static inline void caam_debugfs_init(struct caam_drv_private *ctrlpriv,
 {}
 #endif
 
-#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_CAAM_QI)
+#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI)
 void caam_debugfs_qi_congested(void);
 void caam_debugfs_qi_init(struct caam_drv_private *ctrlpriv);
 #else
diff --git a/drivers/crypto/caam/intern.h b/drivers/crypto/caam/intern.h
index 51c90d17a40d..a88da0d31b23 100644
--- a/drivers/crypto/caam/intern.h
+++ b/drivers/crypto/caam/intern.h
@@ -227,7 +227,7 @@ static inline int caam_prng_register(struct device *dev)
 static inline void caam_prng_unregister(void *data) {}
 #endif /* CONFIG_CRYPTO_DEV_FSL_CAAM_PRNG_API */
 
-#ifdef CONFIG_CAAM_QI
+#ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI
 
 int caam_qi_algapi_init(struct device *dev);
 void caam_qi_algapi_exit(void);
@@ -243,7 +243,7 @@ static inline void caam_qi_algapi_exit(void)
 {
 }
 
-#endif /* CONFIG_CAAM_QI */
+#endif /* CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI */
 
 static inline u64 caam_get_dma_mask(struct device *dev)
 {
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] crypto: caam - avoid option aliasing with the CONFIG_CAAM_QI build option
  2025-07-01 11:20 [PATCH] crypto: caam - avoid option aliasing with the CONFIG_CAAM_QI build option Lukas Bulwahn
@ 2025-07-02  7:38 ` Horia Geanta
  2025-07-18 10:57 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Horia Geanta @ 2025-07-02  7:38 UTC (permalink / raw)
  To: Lukas Bulwahn, Pankaj Gupta, Gaurav Jain, Herbert Xu,
	David S . Miller, linux-crypto@vger.kernel.org
  Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
	Lukas Bulwahn

On 7/1/2025 2:20 PM, Lukas Bulwahn wrote:
> From: Lukas Bulwahn <lukas.bulwahn@redhat.com>
> 
> In the Makefile, the new build option CONFIG_CAAM_QI is defined conditioned
> on the existence of the CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI, which is
> properly defined in the Kconfig file. So, CONFIG_CAAM_QI is just a local
> alias for CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI.
> 
> There is little benefit in the source code of having this slightly shorter
> alias for this configuration, but it complicates further maintenance, as
> searching for the impact of CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI
> requires to grep once, and then identify the option introduced and continue
> searching for that. Further, tools, such as cross referencers, and scripts
> to check Kconfig definitions and their use simply do not handle this
> situation. Given that this is the only incidence of such a config alias in
> the whole kernel tree, just prefer to avoid this pattern of aliasing here.
> 
> Use CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI throughout the Freescale
> CAAM-Multicore platform driver backend source code.
> 
> No functional change.
> 
> Signed-off-by: Lukas Bulwahn <lukas.bulwahn@redhat.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>

Thanks,
Horia


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] crypto: caam - avoid option aliasing with the CONFIG_CAAM_QI build option
  2025-07-01 11:20 [PATCH] crypto: caam - avoid option aliasing with the CONFIG_CAAM_QI build option Lukas Bulwahn
  2025-07-02  7:38 ` Horia Geanta
@ 2025-07-18 10:57 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2025-07-18 10:57 UTC (permalink / raw)
  To: Lukas Bulwahn
  Cc: Horia Geantă, Pankaj Gupta, Gaurav Jain, David S . Miller,
	linux-crypto, kernel-janitors, linux-kernel, Lukas Bulwahn

On Tue, Jul 01, 2025 at 01:20:45PM +0200, Lukas Bulwahn wrote:
> From: Lukas Bulwahn <lukas.bulwahn@redhat.com>
> 
> In the Makefile, the new build option CONFIG_CAAM_QI is defined conditioned
> on the existence of the CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI, which is
> properly defined in the Kconfig file. So, CONFIG_CAAM_QI is just a local
> alias for CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI.
> 
> There is little benefit in the source code of having this slightly shorter
> alias for this configuration, but it complicates further maintenance, as
> searching for the impact of CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI
> requires to grep once, and then identify the option introduced and continue
> searching for that. Further, tools, such as cross referencers, and scripts
> to check Kconfig definitions and their use simply do not handle this
> situation. Given that this is the only incidence of such a config alias in
> the whole kernel tree, just prefer to avoid this pattern of aliasing here.
> 
> Use CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI throughout the Freescale
> CAAM-Multicore platform driver backend source code.
> 
> No functional change.
> 
> Signed-off-by: Lukas Bulwahn <lukas.bulwahn@redhat.com>
> ---
>  drivers/crypto/caam/Makefile  | 4 ----
>  drivers/crypto/caam/ctrl.c    | 6 +++---
>  drivers/crypto/caam/debugfs.c | 2 +-
>  drivers/crypto/caam/debugfs.h | 2 +-
>  drivers/crypto/caam/intern.h  | 4 ++--
>  5 files changed, 7 insertions(+), 11 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-07-18 10:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-01 11:20 [PATCH] crypto: caam - avoid option aliasing with the CONFIG_CAAM_QI build option Lukas Bulwahn
2025-07-02  7:38 ` Horia Geanta
2025-07-18 10:57 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).