diff options
author | Ryder Lee <ryder.lee@mediatek.com> | 2017-03-09 10:11:15 +0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2017-03-16 17:58:53 +0800 |
commit | 3d21c41f7e9b51c70d37b316f11cf5cce9dd3311 (patch) | |
tree | 57a1fccf9f7d5e9399a2c8af74f4b9e743795249 /drivers/crypto/mediatek/mtk-platform.c | |
parent | 82445fe995f4b1edf131157a7328796d5aec1efb (diff) |
crypto: mediatek - simplify descriptor ring management
This patch replaces cmd_pos/res_pos with pointer cmd_next/res_next.
In old code, we must to add one to shift ring to the next segment, and
then use this value to caculate current offset from ring base for each
DMA operation. Now these pointers helps us to simplify flow, so we just
need to move pointers and check the boundaries of ring.
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/mediatek/mtk-platform.c')
-rw-r--r-- | drivers/crypto/mediatek/mtk-platform.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/crypto/mediatek/mtk-platform.c b/drivers/crypto/mediatek/mtk-platform.c index 50de335ed332..b6ecc288b540 100644 --- a/drivers/crypto/mediatek/mtk-platform.c +++ b/drivers/crypto/mediatek/mtk-platform.c @@ -465,6 +465,9 @@ static int mtk_desc_ring_alloc(struct mtk_cryp *cryp) GFP_KERNEL); if (!ring[i]->res_base) goto err_cleanup; + + ring[i]->cmd_next = ring[i]->cmd_base; + ring[i]->res_next = ring[i]->res_base; } return 0; |