[PATCH 07/18] crypto: caam - trivial code clean-up

Marcin Niestroj m.niestroj at grinn-global.com
Mon Sep 3 04:44:41 PDT 2018


Pick commit 4ca7c7d8fea1ffdc36df33578c1e68d0d6367b0c from Linux
upstream.

    crypto: caam - trivial code clean-up

    -replace offsetof with container_of
    -remove unused "assoc_nents", "iv_dma" from aead_edesc
    and fix comments
    -remove unused CAAM_MAX_IV_LENGTH #define

    Signed-off-by: Horia Geantă <horia.geanta at nxp.com>
    Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>

Signed-off-by: Marcin Niestroj <m.niestroj at grinn-global.com>
---
 drivers/crypto/caam/caamrng.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/crypto/caam/caamrng.c b/drivers/crypto/caam/caamrng.c
index 51c267e3d..b62e3eb77 100644
--- a/drivers/crypto/caam/caamrng.c
+++ b/drivers/crypto/caam/caamrng.c
@@ -81,8 +81,7 @@ static void rng_done(struct device_d *jrdev, u32 *desc, u32 err, void *context)
 {
 	struct buf_data *bd;
 
-	bd = (struct buf_data *)((char *)desc -
-	      offsetof(struct buf_data, hw_desc));
+	bd = container_of(desc, struct buf_data, hw_desc[0]);
 
 	if (err)
 		caam_jr_strstatus(jrdev, err);
-- 
2.18.0




More information about the barebox mailing list