Skip to contentSkip to conversation

crypto: Move crypto_yield() to algapi.h

PATCH In review Marek Vasut 2 participants 2 messages May 26, 2014 – Jun 20, 2014 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: Move crypto_yield() to algapi.h

It makes no sense for crypto_yield() to be defined in scatterwalk.h , move it into algapi.h as it's an internal function to crypto API.

---
 include/crypto/algapi.h      | 6 ++++++
 include/crypto/scatterwalk.h | 6 ------
 2 files changed, 6 insertions(+), 6 deletions(-)

NOTE: I didn't manage to compile-test it, but logically it should work, since
scatterwalk.h includes algapi.h .

include/crypto/algapi.h +6 -0
index 016c2f1..623a59c 100644
@@ -410,4 +410,10 @@ static inline int crypto_memneq(const void *a, const void *b, size_t size)
 	return __crypto_memneq(a, b, size) != 0UL ? 1 : 0;
 }
 
+static inline void crypto_yield(u32 flags)
+{
+	if (flags & CRYPTO_TFM_REQ_MAY_SLEEP)
+		cond_resched();
+}
+
 #endif	/* _CRYPTO_ALGAPI_H */
include/crypto/scatterwalk.h +0 -6
index 6a626a5..7ef512f 100644
@@ -25,12 +25,6 @@
 #include <linux/scatterlist.h>
 #include <linux/sched.h>
 
-static inline void crypto_yield(u32 flags)
-{
-	if (flags & CRYPTO_TFM_REQ_MAY_SLEEP)
-		cond_resched();
-}
-
 static inline void scatterwalk_sg_chain(struct scatterlist *sg1, int num,
 					struct scatterlist *sg2)
 {
Signature · 1 line
2.0.0.rc0
maintainer
#1 lore raw
Quoted 5 lines · Marek Vasut

It makes no sense for crypto_yield() to be defined in scatterwalk.h , move it into algapi.h as it's an internal function to crypto API.

Patch applied.

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