diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2016-07-12 01:17:56 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2016-07-18 05:35:49 -0400 |
commit | 4140139734459db4dffc50dad7b9e21ed79a8dd9 (patch) | |
tree | 10195cc22c1bf1c10216a1d1abcf2fe05169c96f | |
parent | 85eccddee401ae81067e763516889780b5545160 (diff) |
crypto: api - Optimise away crypto_yield when hard preemption is on
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>
-rw-r--r-- | include/crypto/algapi.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h index 0483f652ac27..8637cdfe382a 100644 --- a/include/crypto/algapi.h +++ b/include/crypto/algapi.h | |||
@@ -442,8 +442,10 @@ static inline int crypto_memneq(const void *a, const void *b, size_t size) | |||
442 | 442 | ||
443 | static inline void crypto_yield(u32 flags) | 443 | static inline void crypto_yield(u32 flags) |
444 | { | 444 | { |
445 | #if !defined(CONFIG_PREEMPT) || defined(CONFIG_PREEMPT_VOLUNTARY) | ||
445 | if (flags & CRYPTO_TFM_REQ_MAY_SLEEP) | 446 | if (flags & CRYPTO_TFM_REQ_MAY_SLEEP) |
446 | cond_resched(); | 447 | cond_resched(); |
448 | #endif | ||
447 | } | 449 | } |
448 | 450 | ||
449 | #endif /* _CRYPTO_ALGAPI_H */ | 451 | #endif /* _CRYPTO_ALGAPI_H */ |