Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+2
+2
include/crypto/algapi.h
··· 442 442 443 443 static inline void crypto_yield(u32 flags) 444 444 { 445 + #if !defined(CONFIG_PREEMPT) || defined(CONFIG_PREEMPT_VOLUNTARY) 445 446 if (flags & CRYPTO_TFM_REQ_MAY_SLEEP) 446 447 cond_resched(); 448 + #endif 447 449 } 448 450 449 451 #endif /* _CRYPTO_ALGAPI_H */