lkml.org 
[lkml]   [2014]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC][PATCH] signal: replace !likely with unlikely!
Date
From: Li RongQing <roy.qing.li@gmail.com> 

!likely() is hard to be understood, and I do not know if compiler can
optimise this condition, but unlikely(!()) is clear

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
---
kernel/signal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/signal.c b/kernel/signal.c
index 8f0876f..6156cfa 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1571,7 +1571,7 @@ int send_sigqueue(struct sigqueue *q, struct task_struct *t, int group)
BUG_ON(!(q->flags & SIGQUEUE_PREALLOC));

ret = -1;
- if (!likely(lock_task_sighand(t, &flags)))
+ if (unlikely(!lock_task_sighand(t, &flags)))
goto ret;

ret = 1; /* the signal is ignored */
--
1.7.10.4


\
 
 \ /
  Last update: 2014-09-11 03:21    [W:0.048 / U:0.872 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site