Skip to content

Commit

Permalink
jump_label: unlikely(x) > 0
Browse files Browse the repository at this point in the history
if (unlikely(x) > 0) doesn't seem to help branch prediction

Signed-off-by: Roel Kluin <[email protected]>
Cc: Raghavendra K T <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ingo Molnar <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
RoelKluin authored and torvalds committed Nov 13, 2013
1 parent 81e41ea commit 261adc9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/linux/jump_label.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ static __always_inline void jump_label_init(void)

static __always_inline bool static_key_false(struct static_key *key)
{
if (unlikely(atomic_read(&key->enabled)) > 0)
if (unlikely(atomic_read(&key->enabled) > 0))
return true;
return false;
}

static __always_inline bool static_key_true(struct static_key *key)
{
if (likely(atomic_read(&key->enabled)) > 0)
if (likely(atomic_read(&key->enabled) > 0))
return true;
return false;
}
Expand Down

0 comments on commit 261adc9

Please sign in to comment.