Commit 48d62764 authored by Geliang Tang's avatar Geliang Tang Committed by Herbert Xu

crypto: hifn_795x, picoxcell - use ablkcipher_request_cast

Use ablkcipher_request_cast() instead of open-coding it.
Signed-off-by: default avatarGeliang Tang <geliangtang@163.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 2a5de720
...@@ -1943,7 +1943,7 @@ static void hifn_flush(struct hifn_device *dev) ...@@ -1943,7 +1943,7 @@ static void hifn_flush(struct hifn_device *dev)
spin_lock_irqsave(&dev->lock, flags); spin_lock_irqsave(&dev->lock, flags);
while ((async_req = crypto_dequeue_request(&dev->queue))) { 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); spin_unlock_irqrestore(&dev->lock, flags);
hifn_process_ready(req, -ENODEV); hifn_process_ready(req, -ENODEV);
...@@ -2062,7 +2062,7 @@ static int hifn_process_queue(struct hifn_device *dev) ...@@ -2062,7 +2062,7 @@ static int hifn_process_queue(struct hifn_device *dev)
if (backlog) if (backlog)
backlog->complete(backlog, -EINPROGRESS); backlog->complete(backlog, -EINPROGRESS);
req = container_of(async_req, struct ablkcipher_request, base); req = ablkcipher_request_cast(async_req);
err = hifn_handle_req(req); err = hifn_handle_req(req);
if (err) if (err)
......
...@@ -856,8 +856,7 @@ static int spacc_ablk_need_fallback(struct spacc_req *req) ...@@ -856,8 +856,7 @@ static int spacc_ablk_need_fallback(struct spacc_req *req)
static void spacc_ablk_complete(struct spacc_req *req) static void spacc_ablk_complete(struct spacc_req *req)
{ {
struct ablkcipher_request *ablk_req = struct ablkcipher_request *ablk_req = ablkcipher_request_cast(req->req);
container_of(req->req, struct ablkcipher_request, base);
if (ablk_req->src != ablk_req->dst) { if (ablk_req->src != ablk_req->dst) {
spacc_free_ddt(req, req->src_ddt, req->src_addr, ablk_req->src, spacc_free_ddt(req, req->src_ddt, req->src_addr, ablk_req->src,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment