From: Marek Vasut Date: Mon, 26 May 2014 16:51:48 +0000 (+0200) Subject: crypto: skcipher - Don't use __crypto_dequeue_request() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=d656c180de4d3eacd610c414fbcfe2509cf64a99;p=openwrt%2Fstaging%2Fblogic.git crypto: skcipher - Don't use __crypto_dequeue_request() 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 Reported-by: Arnd Bergmann Cc: Pantelis Antoniou Signed-off-by: Herbert Xu --- diff --git a/include/crypto/internal/skcipher.h b/include/crypto/internal/skcipher.h index 06e8b32d541c..b3a46c515d1b 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(