Skip to content

Commit f9981bc

Browse files
KAGA-KOKOherbertx
authored andcommitted
crypto: api - Remove redundant #ifdef in crypto_yield()
While looking at CONFIG_PREEMPT dependencies treewide the #ifdef in crypto_yield() matched. CONFIG_PREEMPT and CONFIG_PREEMPT_VOLUNTARY are mutually exclusive so the extra !CONFIG_PREEMPT conditional is redundant. cond_resched() has only an effect when CONFIG_PREEMPT_VOLUNTARY is set, otherwise it's a stub which the compiler optimizes out. Remove the whole conditional. No functional change. Signed-off-by: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: Herbert Xu <[email protected]> Cc: "David S. Miller" <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 3e75241 commit f9981bc

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

include/crypto/algapi.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,10 +409,8 @@ static inline int crypto_memneq(const void *a, const void *b, size_t size)
409409

410410
static inline void crypto_yield(u32 flags)
411411
{
412-
#if !defined(CONFIG_PREEMPT) || defined(CONFIG_PREEMPT_VOLUNTARY)
413412
if (flags & CRYPTO_TFM_REQ_MAY_SLEEP)
414413
cond_resched();
415-
#endif
416414
}
417415

418416
int crypto_register_notifier(struct notifier_block *nb);

0 commit comments

Comments
 (0)