From patchwork Thu Jul 2 05:18:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lokesh Vutla X-Patchwork-Id: 6707571 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 457BF9F38C for ; Thu, 2 Jul 2015 05:23:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5019A20671 for ; Thu, 2 Jul 2015 05:23:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5B835204E4 for ; Thu, 2 Jul 2015 05:22:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752853AbbGBFWH (ORCPT ); Thu, 2 Jul 2015 01:22:07 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:35618 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751361AbbGBFVv (ORCPT ); Thu, 2 Jul 2015 01:21:51 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id t625LmbM020677; Thu, 2 Jul 2015 00:21:48 -0500 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t625LmBp017319; Thu, 2 Jul 2015 00:21:48 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.224.2; Thu, 2 Jul 2015 00:21:42 -0500 Received: from a0131933.apr.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t625Lb9Y024297; Thu, 2 Jul 2015 00:21:46 -0500 From: Lokesh Vutla To: , , CC: , , , , Subject: [PATCH 03/10] crypto: aead: Add aead_request_cast() api Date: Thu, 2 Jul 2015 10:48:33 +0530 Message-ID: <1435814320-30347-4-git-send-email-lokeshvutla@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1435814320-30347-1-git-send-email-lokeshvutla@ti.com> References: <1435814320-30347-1-git-send-email-lokeshvutla@ti.com> MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Add aead_request_cast() api to get pointer to aead_request from cryto_async_request. Signed-off-by: Lokesh Vutla --- include/linux/crypto.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/crypto.h b/include/linux/crypto.h index 10df5d2..20fac3d 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h @@ -1460,6 +1460,12 @@ static inline void aead_request_set_tfm(struct aead_request *req, req->base.tfm = crypto_aead_tfm(crypto_aead_crt(tfm)->base); } +static inline struct aead_request *aead_request_cast( + struct crypto_async_request *req) +{ + return container_of(req, struct aead_request, base); +} + /** * aead_request_alloc() - allocate request data structure * @tfm: cipher handle to be registered with the request