summaryrefslogtreecommitdiffstats
path: root/crypto/internal.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2020-07-30 22:39:13 +1000
committerHerbert Xu <herbert@gondor.apana.org.au>2020-08-19 21:59:43 +1000
commit1dbb920e342cab987186ad8ed6eac9c1cf710db7 (patch)
tree63c7ffba3228c439f8beb778ed5abcc5e2d634e1 /crypto/internal.h
parent9123e3a74ec7b934a4a099e98af6a61c2f80bbf5 (diff)
downloadlinux-1dbb920e342cab987186ad8ed6eac9c1cf710db7.tar.gz
linux-1dbb920e342cab987186ad8ed6eac9c1cf710db7.tar.bz2
linux-1dbb920e342cab987186ad8ed6eac9c1cf710db7.zip
crypto: algapi - Move crypto_yield into internal.h
This patch moves crypto_yield into internal.h as it's only used by internal code such as skcipher. It also adds a missing inclusion of sched.h which is required for cond_resched. The header files in internal.h have been cleaned up to remove some ancient junk and add some more specific inclusions. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/internal.h')
-rw-r--r--crypto/internal.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/crypto/internal.h b/crypto/internal.h
index 1b92a5a61852..976ec9dfc76d 100644
--- a/crypto/internal.h
+++ b/crypto/internal.h
@@ -10,16 +10,14 @@
#include <crypto/algapi.h>
#include <linux/completion.h>
-#include <linux/mm.h>
-#include <linux/highmem.h>
-#include <linux/interrupt.h>
-#include <linux/init.h>
#include <linux/list.h>
#include <linux/module.h>
-#include <linux/kernel.h>
#include <linux/notifier.h>
+#include <linux/numa.h>
+#include <linux/refcount.h>
#include <linux/rwsem.h>
-#include <linux/slab.h>
+#include <linux/sched.h>
+#include <linux/types.h>
struct crypto_instance;
struct crypto_template;
@@ -140,5 +138,11 @@ static inline void crypto_notify(unsigned long val, void *v)
blocking_notifier_call_chain(&crypto_chain, val, v);
}
+static inline void crypto_yield(u32 flags)
+{
+ if (flags & CRYPTO_TFM_REQ_MAY_SLEEP)
+ cond_resched();
+}
+
#endif /* _CRYPTO_INTERNAL_H */