linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crypto: skcipher: Don't use __crypto_dequeue_request()
@ 2014-05-26 16:51 Marek Vasut
  2014-06-20 18:40 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Marek Vasut @ 2014-05-26 16:51 UTC (permalink / raw)
  To: linux-crypto; +Cc: herbert, Marek Vasut, Pantelis Antoniou

Use skcipher_givcrypt_cast(crypto_dequeue_request(queue)) instead, which
does the same thing in much cleaner way. The skcipher_givcrypt_cast()
actually uses container_of() instead of messing around with offsetof()
too.

Signed-off-by: Marek Vasut <marex@denx.de>
Reported-by: Arnd Bergmann <arnd@arndb.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
---
 include/crypto/internal/skcipher.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

NOTE: I only compile-tested this one.
NOTE: Is there any way we can get rid of __crypto_dequeue_request() for good ?
      I doubt we can, since it's exported symbol and thus part of kernel ABI,
      right?

diff --git a/include/crypto/internal/skcipher.h b/include/crypto/internal/skcipher.h
index 06e8b32..b3a46c5 100644
--- a/include/crypto/internal/skcipher.h
+++ b/include/crypto/internal/skcipher.h
@@ -81,8 +81,7 @@ static inline int skcipher_enqueue_givcrypt(
 static inline struct skcipher_givcrypt_request *skcipher_dequeue_givcrypt(
 	struct crypto_queue *queue)
 {
-	return __crypto_dequeue_request(
-		queue, offsetof(struct skcipher_givcrypt_request, creq.base));
+	return skcipher_givcrypt_cast(crypto_dequeue_request(queue));
 }
 
 static inline void *skcipher_givcrypt_reqctx(
-- 
2.0.0.rc0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] crypto: skcipher: Don't use __crypto_dequeue_request()
  2014-05-26 16:51 [PATCH] crypto: skcipher: Don't use __crypto_dequeue_request() Marek Vasut
@ 2014-06-20 18:40 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2014-06-20 18:40 UTC (permalink / raw)
  To: Marek Vasut; +Cc: linux-crypto, Pantelis Antoniou

On Mon, May 26, 2014 at 06:51:48PM +0200, Marek Vasut wrote:
> Use skcipher_givcrypt_cast(crypto_dequeue_request(queue)) instead, which
> does the same thing in much cleaner way. The skcipher_givcrypt_cast()
> actually uses container_of() instead of messing around with offsetof()
> too.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Cc: Herbert Xu <herbert@gondor.apana.org.au>
> Cc: Pantelis Antoniou <panto@antoniou-consulting.com>

Patch applied.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-06-20 18:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-26 16:51 [PATCH] crypto: skcipher: Don't use __crypto_dequeue_request() Marek Vasut
2014-06-20 18:40 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).