aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Vorontsov <anton.vorontsov@linaro.org>2012-02-09 11:45:19 -0500
committerIngo Molnar <mingo@elte.hu>2012-02-11 09:41:33 -0500
commit9388dc3047a88bedfd867e9ba3e1980c815ac524 (patch)
tree50f30a41607c270b00c04644e069f165a456310a
parented387b781ea6e14b78f449aa2ee4f270b60b01ac (diff)
sched: Turn lock_task_sighand() into a static inline
It appears that sparse tool understands static inline functions for context balance checking, so let's turn the macros into an inline func. This makes the code a little bit more robust. Suggested-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org> Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com> Cc: Greg KH <gregkh@linuxfoundation.org> Cc: Arve <arve@android.com> Cc: San Mehat <san@google.com> Cc: Colin Cross <ccross@android.com> Cc: Eric W. Biederman <ebiederm@xmission.com> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: kernel-team@android.com Cc: linaro-kernel@lists.linaro.org Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20120209164519.GA10266@oksana.dev.rtsoft.ru Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--include/linux/sched.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 92313a3f6f77..5dba2ad52431 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2393,12 +2393,15 @@ static inline void task_unlock(struct task_struct *p)
2393extern struct sighand_struct *__lock_task_sighand(struct task_struct *tsk, 2393extern struct sighand_struct *__lock_task_sighand(struct task_struct *tsk,
2394 unsigned long *flags); 2394 unsigned long *flags);
2395 2395
2396#define lock_task_sighand(tsk, flags) \ 2396static inline struct sighand_struct *lock_task_sighand(struct task_struct *tsk,
2397({ struct sighand_struct *__ss; \ 2397 unsigned long *flags)
2398 __cond_lock(&(tsk)->sighand->siglock, \ 2398{
2399 (__ss = __lock_task_sighand(tsk, flags))); \ 2399 struct sighand_struct *ret;
2400 __ss; \ 2400
2401}) \ 2401 ret = __lock_task_sighand(tsk, flags);
2402 (void)__cond_lock(&tsk->sighand->siglock, ret);
2403 return ret;
2404}
2402 2405
2403static inline void unlock_task_sighand(struct task_struct *tsk, 2406static inline void unlock_task_sighand(struct task_struct *tsk,
2404 unsigned long *flags) 2407 unsigned long *flags)