Skip to content

Commit

Permalink
crypto: algapi - Move crypto_yield into internal.h
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
herbertx committed Aug 19, 2020
1 parent 9123e3a commit 1dbb920
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
16 changes: 10 additions & 6 deletions crypto/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 */

6 changes: 0 additions & 6 deletions include/crypto/algapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,6 @@ 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();
}

int crypto_register_notifier(struct notifier_block *nb);
int crypto_unregister_notifier(struct notifier_block *nb);

Expand Down

0 comments on commit 1dbb920

Please sign in to comment.