crypto: crypto4xx - remove unused definitions and write-only variables

This patch removes several unused code and definitons
(structs, variables, ...).

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Christian Lamparter 2017-08-25 15:47:15 +02:00 committed by Herbert Xu
parent a728a196d2
commit 81065f66dd
3 changed files with 1 additions and 23 deletions

View File

@ -75,7 +75,6 @@ int crypto4xx_encrypt(struct ablkcipher_request *req)
struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
ctx->direction = DIR_OUTBOUND; ctx->direction = DIR_OUTBOUND;
ctx->hash_final = 0;
ctx->is_hash = 0; ctx->is_hash = 0;
ctx->pd_ctl = 0x1; ctx->pd_ctl = 0x1;
@ -89,7 +88,6 @@ int crypto4xx_decrypt(struct ablkcipher_request *req)
struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
ctx->direction = DIR_INBOUND; ctx->direction = DIR_INBOUND;
ctx->hash_final = 0;
ctx->is_hash = 0; ctx->is_hash = 0;
ctx->pd_ctl = 1; ctx->pd_ctl = 1;
@ -136,7 +134,6 @@ static int crypto4xx_setkey_aes(struct crypto_ablkcipher *cipher,
} }
/* Setup SA */ /* Setup SA */
sa = (struct dynamic_sa_ctl *) ctx->sa_in; sa = (struct dynamic_sa_ctl *) ctx->sa_in;
ctx->hash_final = 0;
set_dynamic_sa_command_0(sa, SA_NOT_SAVE_HASH, SA_NOT_SAVE_IV, set_dynamic_sa_command_0(sa, SA_NOT_SAVE_HASH, SA_NOT_SAVE_IV,
SA_LOAD_HASH_FROM_SA, SA_LOAD_IV_FROM_STATE, SA_LOAD_HASH_FROM_SA, SA_LOAD_IV_FROM_STATE,
@ -191,7 +188,6 @@ static int crypto4xx_hash_alg_init(struct crypto_tfm *tfm,
ctx->dev = my_alg->dev; ctx->dev = my_alg->dev;
ctx->is_hash = 1; ctx->is_hash = 1;
ctx->hash_final = 0;
/* Create SA */ /* Create SA */
if (ctx->sa_in_dma_addr || ctx->sa_out_dma_addr) if (ctx->sa_in_dma_addr || ctx->sa_out_dma_addr)
@ -256,7 +252,6 @@ int crypto4xx_hash_update(struct ahash_request *req)
struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
ctx->is_hash = 1; ctx->is_hash = 1;
ctx->hash_final = 0;
ctx->pd_ctl = 0x11; ctx->pd_ctl = 0x11;
ctx->direction = DIR_INBOUND; ctx->direction = DIR_INBOUND;
@ -274,7 +269,6 @@ int crypto4xx_hash_digest(struct ahash_request *req)
{ {
struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
ctx->hash_final = 1;
ctx->pd_ctl = 0x11; ctx->pd_ctl = 0x11;
ctx->direction = DIR_INBOUND; ctx->direction = DIR_INBOUND;

View File

@ -962,7 +962,7 @@ u32 crypto4xx_build_pd(struct crypto_async_request *req,
sa->sa_command_1.bf.hash_crypto_offset = 0; sa->sa_command_1.bf.hash_crypto_offset = 0;
pd->pd_ctl.w = ctx->pd_ctl; pd->pd_ctl.w = ctx->pd_ctl;
pd->pd_ctl_len.w = 0x00400000 | (ctx->bypass << 24) | datalen; pd->pd_ctl_len.w = 0x00400000 | datalen;
pd_uinfo->state = PD_ENTRY_INUSE; pd_uinfo->state = PD_ENTRY_INUSE;
wmb(); wmb();
/* write any value to push engine to read a pd */ /* write any value to push engine to read a pd */

View File

@ -72,7 +72,6 @@ struct pd_uinfo {
struct crypto4xx_device { struct crypto4xx_device {
struct crypto4xx_core_device *core_dev; struct crypto4xx_core_device *core_dev;
char *name; char *name;
u64 ce_phy_address;
void __iomem *ce_base; void __iomem *ce_base;
void __iomem *trng_base; void __iomem *trng_base;
@ -127,21 +126,9 @@ struct crypto4xx_ctx {
u32 sa_len; u32 sa_len;
u32 offset_to_sr_ptr; /* offset to state ptr, in dynamic sa */ u32 offset_to_sr_ptr; /* offset to state ptr, in dynamic sa */
u32 direction; u32 direction;
u32 next_hdr;
u32 save_iv; u32 save_iv;
u32 pd_ctl_len;
u32 pd_ctl; u32 pd_ctl;
u32 bypass;
u32 is_hash; u32 is_hash;
u32 hash_final;
};
struct crypto4xx_req_ctx {
struct crypto4xx_device *dev; /* Device in which
operation to send to */
void *sa;
u32 sa_dma_addr;
u16 sa_len;
}; };
struct crypto4xx_alg_common { struct crypto4xx_alg_common {
@ -172,9 +159,6 @@ static inline struct crypto4xx_alg *crypto_alg_to_crypto4xx_alg(
extern int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size); extern int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size);
extern void crypto4xx_free_sa(struct crypto4xx_ctx *ctx); extern void crypto4xx_free_sa(struct crypto4xx_ctx *ctx);
extern u32 crypto4xx_alloc_sa_rctx(struct crypto4xx_ctx *ctx,
struct crypto4xx_ctx *rctx);
extern void crypto4xx_free_sa_rctx(struct crypto4xx_ctx *rctx);
extern void crypto4xx_free_ctx(struct crypto4xx_ctx *ctx); extern void crypto4xx_free_ctx(struct crypto4xx_ctx *ctx);
extern u32 crypto4xx_alloc_state_record(struct crypto4xx_ctx *ctx); extern u32 crypto4xx_alloc_state_record(struct crypto4xx_ctx *ctx);
extern u32 get_dynamic_sa_offset_state_ptr_field(struct crypto4xx_ctx *ctx); extern u32 get_dynamic_sa_offset_state_ptr_field(struct crypto4xx_ctx *ctx);