[PATCH] crypto: caam - move shared symbols in a common location

From: Iuliana Prodan
Date: Thu Jul 18 2019 - 10:49:19 EST


Moved to a common location the symbols shared by all CAAM drivers (jr,
qi, qi2).

Signed-off-by: Iuliana Prodan <iuliana.prodan@xxxxxxx>
---
This patch depends on series:
https://patchwork.kernel.org/project/linux-crypto/list/?series=147479

drivers/crypto/caam/common_if.c | 7 +++++++
drivers/crypto/caam/common_if.h | 7 +++++++
drivers/crypto/caam/error.c | 6 ------
drivers/crypto/caam/error.h | 5 -----
4 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/drivers/crypto/caam/common_if.c b/drivers/crypto/caam/common_if.c
index 1291d3d..071b08d 100644
--- a/drivers/crypto/caam/common_if.c
+++ b/drivers/crypto/caam/common_if.c
@@ -7,6 +7,13 @@

#include "compat.h"
#include "common_if.h"
+#include <linux/types.h>
+
+bool caam_little_end;
+EXPORT_SYMBOL(caam_little_end);
+
+bool caam_imx;
+EXPORT_SYMBOL(caam_imx);

/*
* validate key length for AES algorithms
diff --git a/drivers/crypto/caam/common_if.h b/drivers/crypto/caam/common_if.h
index 61d5516..5fb8840 100644
--- a/drivers/crypto/caam/common_if.h
+++ b/drivers/crypto/caam/common_if.h
@@ -8,6 +8,8 @@
#ifndef CAAM_COMMON_LOCATION_H
#define CAAM_COMMON_LOCATION_H

+#include "desc.h"
+
int check_aes_keylen(unsigned int keylen);

int check_gcm_authsize(unsigned int authsize);
@@ -16,4 +18,9 @@ int check_rfc4106_authsize(unsigned int authsize);

int check_ipsec_assoclen(unsigned int assoclen);

+static inline bool is_mdha(u32 algtype)
+{
+ return (algtype & OP_ALG_ALGSEL_MASK & ~OP_ALG_ALGSEL_SUBMASK) ==
+ OP_ALG_CHA_MDHA;
+}
#endif /* CAAM_COMMON_LOCATION_H */
diff --git a/drivers/crypto/caam/error.c b/drivers/crypto/caam/error.c
index b7fbf1b..b901872 100644
--- a/drivers/crypto/caam/error.c
+++ b/drivers/crypto/caam/error.c
@@ -50,12 +50,6 @@ void caam_dump_sg(const char *prefix_str, int prefix_type,
#endif /* DEBUG */
EXPORT_SYMBOL(caam_dump_sg);

-bool caam_little_end;
-EXPORT_SYMBOL(caam_little_end);
-
-bool caam_imx;
-EXPORT_SYMBOL(caam_imx);
-
static const struct {
u8 value;
const char *error_text;
diff --git a/drivers/crypto/caam/error.h b/drivers/crypto/caam/error.h
index 16809fa..e2f6ed8 100644
--- a/drivers/crypto/caam/error.h
+++ b/drivers/crypto/caam/error.h
@@ -21,9 +21,4 @@ void caam_dump_sg(const char *prefix_str, int prefix_type,
int rowsize, int groupsize, struct scatterlist *sg,
size_t tlen, bool ascii);

-static inline bool is_mdha(u32 algtype)
-{
- return (algtype & OP_ALG_ALGSEL_MASK & ~OP_ALG_ALGSEL_SUBMASK) ==
- OP_ALG_CHA_MDHA;
-}
#endif /* CAAM_ERROR_H */
--
2.1.0