From: Geliang Tang Date: Mon, 28 Dec 2015 13:53:07 +0000 (+0800) Subject: crypto: hifn_795x, picoxcell - use ablkcipher_request_cast X-Git-Tag: v4.14-rc1~4048^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=48d627648141479c8be8acd110191072e24eba25;p=platform%2Fkernel%2Flinux-rpi.git crypto: hifn_795x, picoxcell - use ablkcipher_request_cast Use ablkcipher_request_cast() instead of open-coding it. Signed-off-by: Geliang Tang Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c index 201e57d..eee2c7e 100644 --- a/drivers/crypto/hifn_795x.c +++ b/drivers/crypto/hifn_795x.c @@ -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) diff --git a/drivers/crypto/picoxcell_crypto.c b/drivers/crypto/picoxcell_crypto.c index 15b5e39..3b1c7ec 100644 --- a/drivers/crypto/picoxcell_crypto.c +++ b/drivers/crypto/picoxcell_crypto.c @@ -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,