diff options
author | Christian Lamparter <chunkeey@gmail.com> | 2019-04-22 07:26:01 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2019-05-03 02:03:29 -0400 |
commit | 38cf5533d7a876f75088bacc1277046f30005f28 (patch) | |
tree | 320510345bb3c35a8bee3cadd09e8783af162473 | |
parent | 9848e4c873c1cae019bbef4ab3a500a05ca59fe6 (diff) |
crypto: crypto4xx - get rid of redundant using_sd variable
using_sd is used as a stand-in for sa_command_0.bf.scatter
that we need to set anyway, so we might as well just prevent
double-accounting.
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r-- | drivers/crypto/amcc/crypto4xx_core.c | 6 | ||||
-rw-r--r-- | drivers/crypto/amcc/crypto4xx_core.h | 1 |
2 files changed, 2 insertions, 5 deletions
diff --git a/drivers/crypto/amcc/crypto4xx_core.c b/drivers/crypto/amcc/crypto4xx_core.c index 3e7d24ff3fa6..3934c2523762 100644 --- a/drivers/crypto/amcc/crypto4xx_core.c +++ b/drivers/crypto/amcc/crypto4xx_core.c | |||
@@ -539,7 +539,7 @@ static void crypto4xx_cipher_done(struct crypto4xx_device *dev, | |||
539 | 539 | ||
540 | req = skcipher_request_cast(pd_uinfo->async_req); | 540 | req = skcipher_request_cast(pd_uinfo->async_req); |
541 | 541 | ||
542 | if (pd_uinfo->using_sd) { | 542 | if (pd_uinfo->sa_va->sa_command_0.bf.scatter) { |
543 | crypto4xx_copy_pkt_to_dst(dev, pd, pd_uinfo, | 543 | crypto4xx_copy_pkt_to_dst(dev, pd, pd_uinfo, |
544 | req->cryptlen, req->dst); | 544 | req->cryptlen, req->dst); |
545 | } else { | 545 | } else { |
@@ -593,7 +593,7 @@ static void crypto4xx_aead_done(struct crypto4xx_device *dev, | |||
593 | u32 icv[AES_BLOCK_SIZE]; | 593 | u32 icv[AES_BLOCK_SIZE]; |
594 | int err = 0; | 594 | int err = 0; |
595 | 595 | ||
596 | if (pd_uinfo->using_sd) { | 596 | if (pd_uinfo->sa_va->sa_command_0.bf.scatter) { |
597 | crypto4xx_copy_pkt_to_dst(dev, pd, pd_uinfo, | 597 | crypto4xx_copy_pkt_to_dst(dev, pd, pd_uinfo, |
598 | pd->pd_ctl_len.bf.pkt_len, | 598 | pd->pd_ctl_len.bf.pkt_len, |
599 | dst); | 599 | dst); |
@@ -887,7 +887,6 @@ int crypto4xx_build_pd(struct crypto_async_request *req, | |||
887 | * we know application give us dst a whole piece of memory | 887 | * we know application give us dst a whole piece of memory |
888 | * no need to use scatter ring. | 888 | * no need to use scatter ring. |
889 | */ | 889 | */ |
890 | pd_uinfo->using_sd = 0; | ||
891 | pd_uinfo->first_sd = 0xffffffff; | 890 | pd_uinfo->first_sd = 0xffffffff; |
892 | sa->sa_command_0.bf.scatter = 0; | 891 | sa->sa_command_0.bf.scatter = 0; |
893 | pd->dest = (u32)dma_map_page(dev->core_dev->device, | 892 | pd->dest = (u32)dma_map_page(dev->core_dev->device, |
@@ -901,7 +900,6 @@ int crypto4xx_build_pd(struct crypto_async_request *req, | |||
901 | u32 sd_idx = fst_sd; | 900 | u32 sd_idx = fst_sd; |
902 | nbytes = datalen; | 901 | nbytes = datalen; |
903 | sa->sa_command_0.bf.scatter = 1; | 902 | sa->sa_command_0.bf.scatter = 1; |
904 | pd_uinfo->using_sd = 1; | ||
905 | pd_uinfo->first_sd = fst_sd; | 903 | pd_uinfo->first_sd = fst_sd; |
906 | sd = crypto4xx_get_sdp(dev, &sd_dma, sd_idx); | 904 | sd = crypto4xx_get_sdp(dev, &sd_dma, sd_idx); |
907 | pd->dest = sd_dma; | 905 | pd->dest = sd_dma; |
diff --git a/drivers/crypto/amcc/crypto4xx_core.h b/drivers/crypto/amcc/crypto4xx_core.h index 4ecc34fa8ebd..c624f8cd3d2e 100644 --- a/drivers/crypto/amcc/crypto4xx_core.h +++ b/drivers/crypto/amcc/crypto4xx_core.h | |||
@@ -64,7 +64,6 @@ union shadow_sa_buf { | |||
64 | struct pd_uinfo { | 64 | struct pd_uinfo { |
65 | struct crypto4xx_device *dev; | 65 | struct crypto4xx_device *dev; |
66 | u32 state; | 66 | u32 state; |
67 | u32 using_sd; | ||
68 | u32 first_gd; /* first gather discriptor | 67 | u32 first_gd; /* first gather discriptor |
69 | used by this packet */ | 68 | used by this packet */ |
70 | u32 num_gd; /* number of gather discriptor | 69 | u32 num_gd; /* number of gather discriptor |