Skip to content

Commit

Permalink
crypto: api - Optimise away crypto_yield when hard preemption is on
Browse files Browse the repository at this point in the history
When hard preemption is enabled there is no need to explicitly
call crypto_yield.  This patch eliminates it if that is the case.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Herbert Xu committed Jul 18, 2016
1 parent 85eccdd commit 4140139
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/crypto/algapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,10 @@ static inline int crypto_memneq(const void *a, const void *b, size_t size)

static inline void crypto_yield(u32 flags)
{
#if !defined(CONFIG_PREEMPT) || defined(CONFIG_PREEMPT_VOLUNTARY)
if (flags & CRYPTO_TFM_REQ_MAY_SLEEP)
cond_resched();
#endif
}

#endif /* _CRYPTO_ALGAPI_H */

0 comments on commit 4140139

Please sign in to comment.