crypto: hifn_795x, picoxcell - use ablkcipher_request_cast
authorGeliang Tang <geliangtang@163.com>
Mon, 28 Dec 2015 13:53:07 +0000 (21:53 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 29 Dec 2015 13:32:44 +0000 (21:32 +0800)
Use ablkcipher_request_cast() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/hifn_795x.c
drivers/crypto/picoxcell_crypto.c

index 201e57dc1c4dac21c3450312f36cf63ab4339663..eee2c7e6c29984c2d258b65e9b424eee8a4ddc1b 100644 (file)
@@ -1943,7 +1943,7 @@ static void hifn_flush(struct hifn_device *dev)
 
        spin_lock_irqsave(&dev->lock, flags);
        while ((async_req = crypto_dequeue_request(&dev->queue))) {
-               req = container_of(async_req, struct ablkcipher_request, base);
+               req = ablkcipher_request_cast(async_req);
                spin_unlock_irqrestore(&dev->lock, flags);
 
                hifn_process_ready(req, -ENODEV);
@@ -2062,7 +2062,7 @@ static int hifn_process_queue(struct hifn_device *dev)
                if (backlog)
                        backlog->complete(backlog, -EINPROGRESS);
 
-               req = container_of(async_req, struct ablkcipher_request, base);
+               req = ablkcipher_request_cast(async_req);
 
                err = hifn_handle_req(req);
                if (err)
index 15b5e39b49246a2b28316ef05817339d31a0b4e6..3b1c7ecf078fea3cb2d4efe7b599c700b6aac8ff 100644 (file)
@@ -856,8 +856,7 @@ static int spacc_ablk_need_fallback(struct spacc_req *req)
 
 static void spacc_ablk_complete(struct spacc_req *req)
 {
-       struct ablkcipher_request *ablk_req =
-               container_of(req->req, struct ablkcipher_request, base);
+       struct ablkcipher_request *ablk_req = ablkcipher_request_cast(req->req);
 
        if (ablk_req->src != ablk_req->dst) {
                spacc_free_ddt(req, req->src_ddt, req->src_addr, ablk_req->src,