crypto: inside-secure - use the base_end pointer in ring rollback
authorAntoine Ténart <antoine.tenart@free-electrons.com>
Thu, 15 Jun 2017 07:56:29 +0000 (09:56 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 20 Jun 2017 03:21:48 +0000 (11:21 +0800)
A base_end pointer is set and provided. Use it in the ring rollback
function to avoid using build-in defines.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/inside-secure/safexcel_ring.c

index fdbf05ae55fc59d5876bf021f0e02e5716c99769..c9d2a8716b5b1059c502a0aa7680115e19f6ecff 100644 (file)
@@ -84,7 +84,7 @@ void safexcel_ring_rollback_wptr(struct safexcel_crypto_priv *priv,
                return;
 
        if (ring->write == ring->base)
-               ring->write += (EIP197_DEFAULT_RING_SIZE - 1) * ring->offset;
+               ring->write = ring->base_end - ring->offset;
        else
                ring->write -= ring->offset;