020-0002-crypto-crypto4xx-remove-unused-definitions-and-write.patch 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. From 81065f66dd99b3af58626a914b8c0fcff6b8b0ba Mon Sep 17 00:00:00 2001
  2. From: Christian Lamparter <[email protected]>
  3. Date: Fri, 25 Aug 2017 15:47:15 +0200
  4. Subject: [PATCH 02/25] crypto: crypto4xx - remove unused definitions and
  5. write-only variables
  6. This patch removes several unused code and definitons
  7. (structs, variables, ...).
  8. Signed-off-by: Christian Lamparter <[email protected]>
  9. Signed-off-by: Herbert Xu <[email protected]>
  10. ---
  11. drivers/crypto/amcc/crypto4xx_alg.c | 6 ------
  12. drivers/crypto/amcc/crypto4xx_core.c | 2 +-
  13. drivers/crypto/amcc/crypto4xx_core.h | 16 ----------------
  14. 3 files changed, 1 insertion(+), 23 deletions(-)
  15. --- a/drivers/crypto/amcc/crypto4xx_alg.c
  16. +++ b/drivers/crypto/amcc/crypto4xx_alg.c
  17. @@ -75,7 +75,6 @@ int crypto4xx_encrypt(struct ablkcipher_
  18. struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
  19. ctx->direction = DIR_OUTBOUND;
  20. - ctx->hash_final = 0;
  21. ctx->is_hash = 0;
  22. ctx->pd_ctl = 0x1;
  23. @@ -89,7 +88,6 @@ int crypto4xx_decrypt(struct ablkcipher_
  24. struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
  25. ctx->direction = DIR_INBOUND;
  26. - ctx->hash_final = 0;
  27. ctx->is_hash = 0;
  28. ctx->pd_ctl = 1;
  29. @@ -136,7 +134,6 @@ static int crypto4xx_setkey_aes(struct c
  30. }
  31. /* Setup SA */
  32. sa = (struct dynamic_sa_ctl *) ctx->sa_in;
  33. - ctx->hash_final = 0;
  34. set_dynamic_sa_command_0(sa, SA_NOT_SAVE_HASH, SA_NOT_SAVE_IV,
  35. SA_LOAD_HASH_FROM_SA, SA_LOAD_IV_FROM_STATE,
  36. @@ -191,7 +188,6 @@ static int crypto4xx_hash_alg_init(struc
  37. ctx->dev = my_alg->dev;
  38. ctx->is_hash = 1;
  39. - ctx->hash_final = 0;
  40. /* Create SA */
  41. if (ctx->sa_in_dma_addr || ctx->sa_out_dma_addr)
  42. @@ -256,7 +252,6 @@ int crypto4xx_hash_update(struct ahash_r
  43. struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
  44. ctx->is_hash = 1;
  45. - ctx->hash_final = 0;
  46. ctx->pd_ctl = 0x11;
  47. ctx->direction = DIR_INBOUND;
  48. @@ -274,7 +269,6 @@ int crypto4xx_hash_digest(struct ahash_r
  49. {
  50. struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
  51. - ctx->hash_final = 1;
  52. ctx->pd_ctl = 0x11;
  53. ctx->direction = DIR_INBOUND;
  54. --- a/drivers/crypto/amcc/crypto4xx_core.c
  55. +++ b/drivers/crypto/amcc/crypto4xx_core.c
  56. @@ -964,7 +964,7 @@ u32 crypto4xx_build_pd(struct crypto_asy
  57. sa->sa_command_1.bf.hash_crypto_offset = 0;
  58. pd->pd_ctl.w = ctx->pd_ctl;
  59. - pd->pd_ctl_len.w = 0x00400000 | (ctx->bypass << 24) | datalen;
  60. + pd->pd_ctl_len.w = 0x00400000 | datalen;
  61. pd_uinfo->state = PD_ENTRY_INUSE;
  62. wmb();
  63. /* write any value to push engine to read a pd */
  64. --- a/drivers/crypto/amcc/crypto4xx_core.h
  65. +++ b/drivers/crypto/amcc/crypto4xx_core.h
  66. @@ -72,7 +72,6 @@ struct pd_uinfo {
  67. struct crypto4xx_device {
  68. struct crypto4xx_core_device *core_dev;
  69. char *name;
  70. - u64 ce_phy_address;
  71. void __iomem *ce_base;
  72. void __iomem *trng_base;
  73. @@ -127,21 +126,9 @@ struct crypto4xx_ctx {
  74. u32 sa_len;
  75. u32 offset_to_sr_ptr; /* offset to state ptr, in dynamic sa */
  76. u32 direction;
  77. - u32 next_hdr;
  78. u32 save_iv;
  79. - u32 pd_ctl_len;
  80. u32 pd_ctl;
  81. - u32 bypass;
  82. u32 is_hash;
  83. - u32 hash_final;
  84. -};
  85. -
  86. -struct crypto4xx_req_ctx {
  87. - struct crypto4xx_device *dev; /* Device in which
  88. - operation to send to */
  89. - void *sa;
  90. - u32 sa_dma_addr;
  91. - u16 sa_len;
  92. };
  93. struct crypto4xx_alg_common {
  94. @@ -172,9 +159,6 @@ static inline struct crypto4xx_alg *cryp
  95. extern int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size);
  96. extern void crypto4xx_free_sa(struct crypto4xx_ctx *ctx);
  97. -extern u32 crypto4xx_alloc_sa_rctx(struct crypto4xx_ctx *ctx,
  98. - struct crypto4xx_ctx *rctx);
  99. -extern void crypto4xx_free_sa_rctx(struct crypto4xx_ctx *rctx);
  100. extern void crypto4xx_free_ctx(struct crypto4xx_ctx *ctx);
  101. extern u32 crypto4xx_alloc_state_record(struct crypto4xx_ctx *ctx);
  102. extern u32 get_dynamic_sa_offset_state_ptr_field(struct crypto4xx_ctx *ctx);