From: Roel Kluin Date: Tue, 12 Nov 2013 23:08:44 +0000 (-0800) Subject: jump_label: unlikely(x) > 0 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=261adc9a609dbfde815337889b9e2c8728959ab8;p=openwrt%2Fstaging%2Fblogic.git jump_label: unlikely(x) > 0 if (unlikely(x) > 0) doesn't seem to help branch prediction Signed-off-by: Roel Kluin Cc: Raghavendra K T Cc: Konrad Rzeszutek Wilk Cc: "H. Peter Anvin" Cc: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h index a5079072da66..cf08540d6204 100644 --- a/include/linux/jump_label.h +++ b/include/linux/jump_label.h @@ -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; }