crypto: marvell/cesa - factor out common import/export functions
authorRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 9 Oct 2015 20:14:22 +0000 (21:14 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 14 Oct 2015 14:23:18 +0000 (22:23 +0800)
commita6479ea487ca8ce11289e88a55a7e348f1ee39ac
tree6a02318c8da23e67e7f9de2ab7fff0bef6db0f34
parentc3bf02a22c5369b25090d12c202ea0807d01978a
crypto: marvell/cesa - factor out common import/export functions

As all the import functions and export functions are virtually
identical, factor out their common parts into a generic
mv_cesa_ahash_import() and mv_cesa_ahash_export() respectively.  This
performs the actual import or export, and we pass the data pointers and
length into these functions.

We have to switch a % const operation to do_div() in the common import
function to avoid provoking gcc to use the expensive 64-bit by 64-bit
modulus operation.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/marvell/hash.c