crypto: marvell/cesa - use memcpy_and_pad in mv_cesa_ahash_export
Subsystems (2)
PATCH 1/1 crypto: marvell/cesa - use memcpy_and_pad in mv_cesa_ahash_export
Replace memset() followed by memcpy() with memcpy_and_pad() to simplify the code and to write to 'cache' only once.
Signed-off-by Thorsten Blum <[email protected]>
--- drivers/crypto/marvell/cesa/hash.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/crypto/marvell/cesa/hash.c +1 -2
@@ -847,8 +847,7 @@ static int mv_cesa_ahash_export(struct ahash_request *req, void *hash, *len = creq->len;memcpy (hash, creq->state, digsize); -memset (cache,0 , blocksize); -memcpy (cache, creq->cache, creq->cache_ptr); +memcpy_and_pad (cache, blocksize, creq->cache, creq->cache_ptr,0 );return 0 ; }
Herbert Xu
maintainerQuoted 7 lines · Thorsten Blum
Replace
memset()followed bymemcpy()withmemcpy_and_pad()to simplify the code and to write to 'cache' only once.Signed-off-by Thorsten Blum <[email protected]>--- drivers/crypto/marvell/cesa/hash.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt