Skip to content

Commit 48d6276

Browse files
geliangtangherbertx
authored andcommitted
crypto: hifn_795x, picoxcell - use ablkcipher_request_cast
Use ablkcipher_request_cast() instead of open-coding it. Signed-off-by: Geliang Tang <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 2a5de72 commit 48d6276

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

drivers/crypto/hifn_795x.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1943,7 +1943,7 @@ static void hifn_flush(struct hifn_device *dev)
19431943

19441944
spin_lock_irqsave(&dev->lock, flags);
19451945
while ((async_req = crypto_dequeue_request(&dev->queue))) {
1946-
req = container_of(async_req, struct ablkcipher_request, base);
1946+
req = ablkcipher_request_cast(async_req);
19471947
spin_unlock_irqrestore(&dev->lock, flags);
19481948

19491949
hifn_process_ready(req, -ENODEV);
@@ -2062,7 +2062,7 @@ static int hifn_process_queue(struct hifn_device *dev)
20622062
if (backlog)
20632063
backlog->complete(backlog, -EINPROGRESS);
20642064

2065-
req = container_of(async_req, struct ablkcipher_request, base);
2065+
req = ablkcipher_request_cast(async_req);
20662066

20672067
err = hifn_handle_req(req);
20682068
if (err)

drivers/crypto/picoxcell_crypto.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -856,8 +856,7 @@ static int spacc_ablk_need_fallback(struct spacc_req *req)
856856

857857
static void spacc_ablk_complete(struct spacc_req *req)
858858
{
859-
struct ablkcipher_request *ablk_req =
860-
container_of(req->req, struct ablkcipher_request, base);
859+
struct ablkcipher_request *ablk_req = ablkcipher_request_cast(req->req);
861860

862861
if (ablk_req->src != ablk_req->dst) {
863862
spacc_free_ddt(req, req->src_ddt, req->src_addr, ablk_req->src,

0 commit comments

Comments
 (0)