From patchwork Mon Dec 28 13:53:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 7926151 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5DA15BEEE5 for ; Mon, 28 Dec 2015 13:56:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8EBB520263 for ; Mon, 28 Dec 2015 13:56:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2FF172025A for ; Mon, 28 Dec 2015 13:56:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751037AbbL1N4m (ORCPT ); Mon, 28 Dec 2015 08:56:42 -0500 Received: from m50-135.163.com ([123.125.50.135]:35720 "EHLO m50-135.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750887AbbL1N4l (ORCPT ); Mon, 28 Dec 2015 08:56:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=rBwoRIqhdFD28VUpBD NhUaBKuv5eQmnJKsVn4EI3vd8=; b=QhphhGE7tk/yLZwV7jIFzSKjYGBKpumfSB GxGQ60K+th3A6+bcITm65uioD7p7bm7uV3wIsiNG+FmB46eR3/sMTqju5S/WnT7y yquGmbYV6Wxsb5rVnr+lpYAtIUve2FheGf+i5muC0lgnBzjFCK4ztLZuP3QtwahI ApYWd0irk= Received: from localhost (unknown [116.77.133.48]) by smtp5 (Coremail) with SMTP id D9GowAA3xsrLPoFWb6IpCA--.310S3; Mon, 28 Dec 2015 21:53:18 +0800 (CST) From: Geliang Tang To: Herbert Xu , "David S. Miller" , Jamie Iles Cc: Geliang Tang , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] crypto: hifn_795x, picoxcell - use ablkcipher_request_cast Date: Mon, 28 Dec 2015 21:53:07 +0800 Message-Id: <9b6f300df7ffd4c5d65253fdbbb2d1a1cba04835.1451310459.git.geliangtang@163.com> X-Mailer: git-send-email 2.5.0 X-CM-TRANSID: D9GowAA3xsrLPoFWb6IpCA--.310S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7KFWxJrWUuw4UWrW5tw47urg_yoW8Cr18pF 45JrZ2krWUWw4xurW8CF18ZF95Xa97ZFy3KrW8Jw1fZrsrJFyvqF4aya4UZFsxXr4kZr4j gr4qk3y5XFn2yFJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UIdgAUUUUU= X-Originating-IP: [116.77.133.48] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/1tbiGQ7emVXlQM-3WwAAsD Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use ablkcipher_request_cast() instead of open-coding it. Signed-off-by: Geliang Tang --- drivers/crypto/hifn_795x.c | 4 ++-- drivers/crypto/picoxcell_crypto.c | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) 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,