OSDN Git Service

crypto: caam - replace sg_count() with sg_nents_for_len()
authorHoria Geantă <horia.geanta@nxp.com>
Fri, 10 Feb 2017 12:07:19 +0000 (14:07 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 15 Feb 2017 05:23:39 +0000 (13:23 +0800)
commitfa0c92db1eb818a36c1b837b5f6da7e95b181247
treeea919e3f21fb0fbff4c7e5dd6e4eadf88904371e
parentfd144d83cc42cfe6c82cba76bc0113dacd53a4d4
crypto: caam - replace sg_count() with sg_nents_for_len()

Replace internal sg_count() function and the convoluted logic
around it with the standard sg_nents_for_len() function.
src_nents, dst_nents now hold the number of SW S/G entries,
instead of the HW S/G table entries.

With this change, null (zero length) input data for AEAD case
needs to be handled in a visible way. req->src is no longer
(un)mapped, pointer address is set to 0 in SEQ IN PTR command.

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/caam/caamalg.c
drivers/crypto/caam/sg_sw_sec4.h