diff mbox

[v2,5/7] crypto: aead: Add aead_request_cast() api

Message ID 1436283109-13318-6-git-send-email-lokeshvutla@ti.com (mailing list archive)
State Rejected
Delegated to: Herbert Xu
Headers show

Commit Message

Lokesh Vutla July 7, 2015, 3:31 p.m. UTC
Add aead_request_cast() api to get pointer to aead_request
from cryto_async_request.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
 include/crypto/internal/aead.h | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Herbert Xu July 8, 2015, 3:56 a.m. UTC | #1
On Tue, Jul 07, 2015 at 09:01:47PM +0530, Lokesh Vutla wrote:
> Add aead_request_cast() api to get pointer to aead_request
> from cryto_async_request.
> 
> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
> ---
>  include/crypto/internal/aead.h | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/include/crypto/internal/aead.h b/include/crypto/internal/aead.h
> index 4b25471..0423fa5 100644
> --- a/include/crypto/internal/aead.h
> +++ b/include/crypto/internal/aead.h
> @@ -157,6 +157,12 @@ static inline unsigned int crypto_aead_maxauthsize(struct crypto_aead *aead)
>  	return crypto_aead_alg_maxauthsize(crypto_aead_alg(aead));
>  }
>  
> +static inline struct aead_request *aead_request_cast(
> +					struct crypto_async_request *req)
> +{
> +	return container_of(req, struct aead_request, base);
> +}

Please drop this and use the aead_queue interface I just posted.

Thanks,
Lokesh Vutla July 8, 2015, 6:43 a.m. UTC | #2
On Wednesday 08 July 2015 09:26 AM, Herbert Xu wrote:
> On Tue, Jul 07, 2015 at 09:01:47PM +0530, Lokesh Vutla wrote:
>> Add aead_request_cast() api to get pointer to aead_request
>> from cryto_async_request.
>>
>> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
>> ---
>>  include/crypto/internal/aead.h | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/include/crypto/internal/aead.h b/include/crypto/internal/aead.h
>> index 4b25471..0423fa5 100644
>> --- a/include/crypto/internal/aead.h
>> +++ b/include/crypto/internal/aead.h
>> @@ -157,6 +157,12 @@ static inline unsigned int crypto_aead_maxauthsize(struct crypto_aead *aead)
>>  	return crypto_aead_alg_maxauthsize(crypto_aead_alg(aead));
>>  }
>>  
>> +static inline struct aead_request *aead_request_cast(
>> +					struct crypto_async_request *req)
>> +{
>> +	return container_of(req, struct aead_request, base);
>> +}
> 
> Please drop this and use the aead_queue interface I just posted.
Okay will update in next version

Thanks and regards,
Lokesh
> 
> Thanks,
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/include/crypto/internal/aead.h b/include/crypto/internal/aead.h
index 4b25471..0423fa5 100644
--- a/include/crypto/internal/aead.h
+++ b/include/crypto/internal/aead.h
@@ -157,6 +157,12 @@  static inline unsigned int crypto_aead_maxauthsize(struct crypto_aead *aead)
 	return crypto_aead_alg_maxauthsize(crypto_aead_alg(aead));
 }
 
+static inline struct aead_request *aead_request_cast(
+					struct crypto_async_request *req)
+{
+	return container_of(req, struct aead_request, base);
+}
+
 int crypto_register_aead(struct aead_alg *alg);
 void crypto_unregister_aead(struct aead_alg *alg);
 int crypto_register_aeads(struct aead_alg *algs, int count);