Skip to contentSkip to conversation

arch/x86/kernel/signal_32.c: replace !likely(x) by likely(!x)

PATCH In review Roel Kluin 2 participants 4 messages Feb 16, 2008 – Feb 17, 2008 x86

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/2 arch/x86/kernel/signal_32.c: replace !likely(x) by likely(!x)

Replace !likely(x) by likely(!x)

---

arch/x86/kernel/signal_32.c +1 -1
index caee1f0..335872f 100644
@@ -303,7 +303,7 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
 	 * If we are on the alternate signal stack and would overflow it, don't.
 	 * Return an always-bogus address instead so we will die with SIGSEGV.
 	 */
-	if (on_sig_stack(sp) && !likely(on_sig_stack(sp - frame_size)))
+	if (on_sig_stack(sp) && likely(!on_sig_stack(sp - frame_size)))
 		return (void __user *) -1L;
 
 	/* This is the X/Open sanctioned signal stack switching.  */
author
#1 lore raw
Quoted 9 lines · Roel Kluin

Replace !likely(x) by likely(!x)

---

arch/x86/kernel/signal_32.c +0 -0
index caee1f0..335872f 100644

arch/x86/kernel/signal_32.c get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)

Quoted 9 lines
arch/x86/kernel/signal_32.c +1 -2
@@ -303,7 +303,7 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
 	 * If we are on the alternate signal stack and would overflow it, don't.
 	 * Return an always-bogus address instead so we will die with SIGSEGV.
 	 */
-	if (on_sig_stack(sp) && !likely(on_sig_stack(sp - frame_size)))
+	if (on_sig_stack(sp) && likely(!on_sig_stack(sp - frame_size)))
 		return (void __user *) -1L;
 
 	/* This is the X/Open sanctioned signal stack switching.  */
--

sorry, please ignore this patch

author
#2 lore raw
Quoted 4 lines · Roel Kluin
Quoted 1 line · Roel Kluin

Replace !likely(x) by likely(!x)

sorry, please ignore this patch

The patch below shouldn't change semantics.
---
replace !likely(x) by unlikely(!x)

---

arch/x86/kernel/signal_32.c +1 -1
index caee1f0..c0fb075 100644
@@ -303,7 +303,7 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
 	 * If we are on the alternate signal stack and would overflow it, don't.
 	 * Return an always-bogus address instead so we will die with SIGSEGV.
 	 */
-	if (on_sig_stack(sp) && !likely(on_sig_stack(sp - frame_size)))
+	if (on_sig_stack(sp) && unlikely(!on_sig_stack(sp - frame_size)))
 		return (void __user *) -1L;
 
 	/* This is the X/Open sanctioned signal stack switching.  */
#3 lore raw

arch/x86/kernel/signal_32.c get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size) · line 306

Quoted 2 lines · Roel Kluin
arch/x86/kernel/signal_32.c +1 -1
-	if (on_sig_stack(sp) && !likely(on_sig_stack(sp - frame_size)))
+	if (on_sig_stack(sp) && unlikely(!on_sig_stack(sp - frame_size)))

hm, what's the purpose of this change?

Ingo