Skip to content

Commit

Permalink
crypto: hifn_795x, picoxcell - use ablkcipher_request_cast
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Geliang Tang authored and Herbert Xu committed Dec 29, 2015
1 parent 2a5de72 commit 48d6276
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions drivers/crypto/hifn_795x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions drivers/crypto/picoxcell_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 48d6276

Please sign in to comment.