1 From 81065f66dd99b3af58626a914b8c0fcff6b8b0ba Mon Sep 17 00:00:00 2001
2 From: Christian Lamparter <chunkeey@googlemail.com>
3 Date: Fri, 25 Aug 2017 15:47:15 +0200
4 Subject: [PATCH 02/25] crypto: crypto4xx - remove unused definitions and
7 This patch removes several unused code and definitons
8 (structs, variables, ...).
10 Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
13 drivers/crypto/amcc/crypto4xx_alg.c | 6 ------
14 drivers/crypto/amcc/crypto4xx_core.c | 2 +-
15 drivers/crypto/amcc/crypto4xx_core.h | 16 ----------------
16 3 files changed, 1 insertion(+), 23 deletions(-)
18 --- a/drivers/crypto/amcc/crypto4xx_alg.c
19 +++ b/drivers/crypto/amcc/crypto4xx_alg.c
20 @@ -75,7 +75,6 @@ int crypto4xx_encrypt(struct ablkcipher_
21 struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
23 ctx->direction = DIR_OUTBOUND;
24 - ctx->hash_final = 0;
28 @@ -89,7 +88,6 @@ int crypto4xx_decrypt(struct ablkcipher_
29 struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
31 ctx->direction = DIR_INBOUND;
32 - ctx->hash_final = 0;
36 @@ -136,7 +134,6 @@ static int crypto4xx_setkey_aes(struct c
39 sa = (struct dynamic_sa_ctl *) ctx->sa_in;
40 - ctx->hash_final = 0;
42 set_dynamic_sa_command_0(sa, SA_NOT_SAVE_HASH, (cm == CRYPTO_MODE_CBC ?
43 SA_SAVE_IV : SA_NOT_SAVE_IV),
44 @@ -192,7 +189,6 @@ static int crypto4xx_hash_alg_init(struc
46 ctx->dev = my_alg->dev;
48 - ctx->hash_final = 0;
51 if (ctx->sa_in_dma_addr || ctx->sa_out_dma_addr)
52 @@ -257,7 +253,6 @@ int crypto4xx_hash_update(struct ahash_r
53 struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
56 - ctx->hash_final = 0;
58 ctx->direction = DIR_INBOUND;
60 @@ -275,7 +270,6 @@ int crypto4xx_hash_digest(struct ahash_r
62 struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
64 - ctx->hash_final = 1;
66 ctx->direction = DIR_INBOUND;
68 --- a/drivers/crypto/amcc/crypto4xx_core.c
69 +++ b/drivers/crypto/amcc/crypto4xx_core.c
70 @@ -969,7 +969,7 @@ u32 crypto4xx_build_pd(struct crypto_asy
72 sa->sa_command_1.bf.hash_crypto_offset = 0;
73 pd->pd_ctl.w = ctx->pd_ctl;
74 - pd->pd_ctl_len.w = 0x00400000 | (ctx->bypass << 24) | datalen;
75 + pd->pd_ctl_len.w = 0x00400000 | datalen;
76 pd_uinfo->state = PD_ENTRY_INUSE;
78 /* write any value to push engine to read a pd */
79 --- a/drivers/crypto/amcc/crypto4xx_core.h
80 +++ b/drivers/crypto/amcc/crypto4xx_core.h
81 @@ -72,7 +72,6 @@ struct pd_uinfo {
82 struct crypto4xx_device {
83 struct crypto4xx_core_device *core_dev;
86 void __iomem *ce_base;
87 void __iomem *trng_base;
89 @@ -127,21 +126,9 @@ struct crypto4xx_ctx {
91 u32 offset_to_sr_ptr; /* offset to state ptr, in dynamic sa */
102 -struct crypto4xx_req_ctx {
103 - struct crypto4xx_device *dev; /* Device in which
104 - operation to send to */
110 struct crypto4xx_alg_common {
111 @@ -172,9 +159,6 @@ static inline struct crypto4xx_alg *cryp
113 extern int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size);
114 extern void crypto4xx_free_sa(struct crypto4xx_ctx *ctx);
115 -extern u32 crypto4xx_alloc_sa_rctx(struct crypto4xx_ctx *ctx,
116 - struct crypto4xx_ctx *rctx);
117 -extern void crypto4xx_free_sa_rctx(struct crypto4xx_ctx *rctx);
118 extern void crypto4xx_free_ctx(struct crypto4xx_ctx *ctx);
119 extern u32 crypto4xx_alloc_state_record(struct crypto4xx_ctx *ctx);
120 extern u32 get_dynamic_sa_offset_state_ptr_field(struct crypto4xx_ctx *ctx);