Skip to content

Commit

Permalink
crypto: api - Remove redundant #ifdef in crypto_yield()
Browse files Browse the repository at this point in the history
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 <tglx@linutronix.de>
Cc: linux-crypto@vger.kernel.org
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Thomas Gleixner authored and Herbert Xu committed Aug 2, 2019
1 parent 3e75241 commit f9981bc
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions include/crypto/algapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,8 @@ 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
}

int crypto_register_notifier(struct notifier_block *nb);
Expand Down

0 comments on commit f9981bc

Please sign in to comment.