Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: caam - avoid option aliasing with the CONFIG_CAAM_QI build option

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>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Lukas Bulwahn and committed by
Herbert Xu
75e2d4b1 26abce25

+7 -11
-4
drivers/crypto/caam/Makefile
··· 25 25 caam_jr-$(CONFIG_CRYPTO_DEV_FSL_CAAM_BLOB_GEN) += blob_gen.o 26 26 27 27 caam-$(CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI) += qi.o 28 - ifneq ($(CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI),) 29 - ccflags-y += -DCONFIG_CAAM_QI 30 - endif 31 - 32 28 caam-$(CONFIG_DEBUG_FS) += debugfs.o 33 29 34 30 obj-$(CONFIG_CRYPTO_DEV_FSL_DPAA2_CAAM) += dpaa2_caam.o
+3 -3
drivers/crypto/caam/ctrl.c
··· 24 24 bool caam_dpaa2; 25 25 EXPORT_SYMBOL(caam_dpaa2); 26 26 27 - #ifdef CONFIG_CAAM_QI 27 + #ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI 28 28 #include "qi.h" 29 29 #endif 30 30 ··· 968 968 caam_dpaa2 = !!(comp_params & CTPR_MS_DPAA2); 969 969 ctrlpriv->qi_present = !!(comp_params & CTPR_MS_QI_MASK); 970 970 971 - #ifdef CONFIG_CAAM_QI 971 + #ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI 972 972 /* If (DPAA 1.x) QI present, check whether dependencies are available */ 973 973 if (ctrlpriv->qi_present && !caam_dpaa2) { 974 974 ret = qman_is_probed(); ··· 1099 1099 wr_reg32(&ctrlpriv->qi->qi_control_lo, QICTL_DQEN); 1100 1100 1101 1101 /* If QMAN driver is present, init CAAM-QI backend */ 1102 - #ifdef CONFIG_CAAM_QI 1102 + #ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI 1103 1103 ret = caam_qi_init(pdev); 1104 1104 if (ret) 1105 1105 dev_err(dev, "caam qi i/f init failed: %d\n", ret);
+1 -1
drivers/crypto/caam/debugfs.c
··· 22 22 DEFINE_DEBUGFS_ATTRIBUTE(caam_fops_u32_ro, caam_debugfs_u32_get, NULL, "%llu\n"); 23 23 DEFINE_DEBUGFS_ATTRIBUTE(caam_fops_u64_ro, caam_debugfs_u64_get, NULL, "%llu\n"); 24 24 25 - #ifdef CONFIG_CAAM_QI 25 + #ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI 26 26 /* 27 27 * This is a counter for the number of times the congestion group (where all 28 28 * the request and response queueus are) reached congestion. Incremented
+1 -1
drivers/crypto/caam/debugfs.h
··· 18 18 {} 19 19 #endif 20 20 21 - #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_CAAM_QI) 21 + #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI) 22 22 void caam_debugfs_qi_congested(void); 23 23 void caam_debugfs_qi_init(struct caam_drv_private *ctrlpriv); 24 24 #else
+2 -2
drivers/crypto/caam/intern.h
··· 227 227 static inline void caam_prng_unregister(void *data) {} 228 228 #endif /* CONFIG_CRYPTO_DEV_FSL_CAAM_PRNG_API */ 229 229 230 - #ifdef CONFIG_CAAM_QI 230 + #ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI 231 231 232 232 int caam_qi_algapi_init(struct device *dev); 233 233 void caam_qi_algapi_exit(void); ··· 243 243 { 244 244 } 245 245 246 - #endif /* CONFIG_CAAM_QI */ 246 + #endif /* CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI */ 247 247 248 248 static inline u64 caam_get_dma_mask(struct device *dev) 249 249 {