Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752440AbbGBJrI (ORCPT ); Thu, 2 Jul 2015 05:47:08 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:46283 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753146AbbGBJrB (ORCPT ); Thu, 2 Jul 2015 05:47:01 -0400 Message-ID: <5595088B.30500@ti.com> Date: Thu, 2 Jul 2015 15:16:51 +0530 From: Lokesh Vutla User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120912 Thunderbird/15.0.1 MIME-Version: 1.0 To: CC: , , , , , , Subject: Re: [PATCH 03/10] crypto: aead: Add aead_request_cast() api References: <1435814320-30347-1-git-send-email-lokeshvutla@ti.com> <1435814320-30347-4-git-send-email-lokeshvutla@ti.com> <20150702075807.GC4033@saruman.tx.rr.com> In-Reply-To: <20150702075807.GC4033@saruman.tx.rr.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1326 Lines: 36 On Thursday 02 July 2015 01:28 PM, Felipe Balbi wrote: > On Thu, Jul 02, 2015 at 10:48:33AM +0530, Lokesh Vutla wrote: >> 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); > > container_of() ensures type safety, this can be a macro just fine. There are many similar definitions for ablkcipher.. etc,in crypto library. So I tried to make it uniform for the entire library. Thanks and regards, Lokesh > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/