Skip to contentSkip to conversation

crypto: aead - move aead_request_cast helper to aead.h

PATCH Superseded Tadeusz Struk 2 participants 4 messages Jan 27, 2016 – Feb 1, 2016

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: aead - move aead_request_cast helper to aead.h

Move the helper function to common header for everybody to use.

---
 drivers/crypto/atmel-aes.c |    6 ------
 include/crypto/aead.h      |    6 ++++++
 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/crypto/atmel-aes.c +0 -6
index 6dd3317..949af89 100644
@@ -369,12 +369,6 @@ static inline size_t atmel_aes_padlen(size_t len, size_t block_size)
 	return len ? block_size - len : 0;
 }
 
-static inline struct aead_request *
-aead_request_cast(struct crypto_async_request *req)
-{
-	return container_of(req, struct aead_request, base);
-}
-
 static struct atmel_aes_dev *atmel_aes_find_dev(struct atmel_aes_base_ctx *ctx)
 {
 	struct atmel_aes_dev *aes_dd = NULL;
include/crypto/aead.h +6 -0
index 84d13b1..2de15fc 100644
@@ -304,6 +304,12 @@ static inline struct crypto_aead *crypto_aead_reqtfm(struct aead_request *req)
 	return __crypto_aead_cast(req->base.tfm);
 }
 
+static inline struct aead_request *aead_request_cast(
+					struct crypto_async_request *req)
+{
+	return container_of(req, struct aead_request, base);
+}
+
 /**
  * crypto_aead_encrypt() - encrypt plaintext
  * @req: reference to the aead_request handle that holds all information
maintainer
#1 lore raw
Quoted 3 lines · Tadeusz Struk

Move the helper function to common header for everybody to use.

This should go into internal/aead.h if at all. Longer term we should look for ways to do away with direct uses of crypto_async_request.

Thanks,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
#2 lore raw
Quoted 4 lines · Herbert Xu
Quoted 3 lines

Move the helper function to common header for everybody to use.

Quoted 2 lines

This should go into internal/aead.h if at all.

Yes, I though about it, but I followed skcipher. The skcipher_request_cast() helper is in crypto/skcipher.h not in crypto/internal/skcipher.h Shouldn't this be consistent?
Thanks,

Signature · 1 line
TS
maintainer
#3 lore raw
Quoted 4 lines · Tadeusz Struk

Yes, I though about it, but I followed skcipher. The skcipher_request_cast() helper is in crypto/skcipher.h not in crypto/internal/skcipher.h Shouldn't this be consistent?

Yes it should be moved into internal as well.

Cheers,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt