Skip to content

Commit 75e2d4b

Browse files
bulwahnherbertx
authored andcommitted
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>
1 parent 26abce2 commit 75e2d4b

5 files changed

Lines changed: 7 additions & 11 deletions

File tree

drivers/crypto/caam/Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ caam_jr-$(CONFIG_CRYPTO_DEV_FSL_CAAM_PKC_API) += caampkc.o pkc_desc.o
2525
caam_jr-$(CONFIG_CRYPTO_DEV_FSL_CAAM_BLOB_GEN) += blob_gen.o
2626

2727
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-
3228
caam-$(CONFIG_DEBUG_FS) += debugfs.o
3329

3430
obj-$(CONFIG_CRYPTO_DEV_FSL_DPAA2_CAAM) += dpaa2_caam.o

drivers/crypto/caam/ctrl.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
bool caam_dpaa2;
2525
EXPORT_SYMBOL(caam_dpaa2);
2626

27-
#ifdef CONFIG_CAAM_QI
27+
#ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI
2828
#include "qi.h"
2929
#endif
3030

@@ -968,7 +968,7 @@ static int caam_probe(struct platform_device *pdev)
968968
caam_dpaa2 = !!(comp_params & CTPR_MS_DPAA2);
969969
ctrlpriv->qi_present = !!(comp_params & CTPR_MS_QI_MASK);
970970

971-
#ifdef CONFIG_CAAM_QI
971+
#ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI
972972
/* If (DPAA 1.x) QI present, check whether dependencies are available */
973973
if (ctrlpriv->qi_present && !caam_dpaa2) {
974974
ret = qman_is_probed();
@@ -1099,7 +1099,7 @@ static int caam_probe(struct platform_device *pdev)
10991099
wr_reg32(&ctrlpriv->qi->qi_control_lo, QICTL_DQEN);
11001100

11011101
/* If QMAN driver is present, init CAAM-QI backend */
1102-
#ifdef CONFIG_CAAM_QI
1102+
#ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI
11031103
ret = caam_qi_init(pdev);
11041104
if (ret)
11051105
dev_err(dev, "caam qi i/f init failed: %d\n", ret);

drivers/crypto/caam/debugfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static int caam_debugfs_u32_get(void *data, u64 *val)
2222
DEFINE_DEBUGFS_ATTRIBUTE(caam_fops_u32_ro, caam_debugfs_u32_get, NULL, "%llu\n");
2323
DEFINE_DEBUGFS_ATTRIBUTE(caam_fops_u64_ro, caam_debugfs_u64_get, NULL, "%llu\n");
2424

25-
#ifdef CONFIG_CAAM_QI
25+
#ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI
2626
/*
2727
* This is a counter for the number of times the congestion group (where all
2828
* the request and response queueus are) reached congestion. Incremented

drivers/crypto/caam/debugfs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ static inline void caam_debugfs_init(struct caam_drv_private *ctrlpriv,
1818
{}
1919
#endif
2020

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)
2222
void caam_debugfs_qi_congested(void);
2323
void caam_debugfs_qi_init(struct caam_drv_private *ctrlpriv);
2424
#else

drivers/crypto/caam/intern.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ static inline int caam_prng_register(struct device *dev)
227227
static inline void caam_prng_unregister(void *data) {}
228228
#endif /* CONFIG_CRYPTO_DEV_FSL_CAAM_PRNG_API */
229229

230-
#ifdef CONFIG_CAAM_QI
230+
#ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI
231231

232232
int caam_qi_algapi_init(struct device *dev);
233233
void caam_qi_algapi_exit(void);
@@ -243,7 +243,7 @@ static inline void caam_qi_algapi_exit(void)
243243
{
244244
}
245245

246-
#endif /* CONFIG_CAAM_QI */
246+
#endif /* CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI */
247247

248248
static inline u64 caam_get_dma_mask(struct device *dev)
249249
{

0 commit comments

Comments
 (0)