From: Anton Vorontsov Date: Thu, 9 Feb 2012 16:45:19 +0000 (+0400) Subject: sched: Turn lock_task_sighand() into a static inline X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=9388dc3047a88bedfd867e9ba3e1980c815ac524;p=openwrt%2Fstaging%2Fblogic.git 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 Signed-off-by: Anton Vorontsov Cc: KOSAKI Motohiro Cc: Greg KH Cc: Arve Cc: San Mehat Cc: Colin Cross Cc: Eric W. Biederman Cc: Paul E. McKenney Cc: kernel-team@android.com Cc: linaro-kernel@lists.linaro.org Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20120209164519.GA10266@oksana.dev.rtsoft.ru Signed-off-by: Ingo Molnar --- 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) extern struct sighand_struct *__lock_task_sighand(struct task_struct *tsk, unsigned long *flags); -#define lock_task_sighand(tsk, flags) \ -({ struct sighand_struct *__ss; \ - __cond_lock(&(tsk)->sighand->siglock, \ - (__ss = __lock_task_sighand(tsk, flags))); \ - __ss; \ -}) \ +static inline struct sighand_struct *lock_task_sighand(struct task_struct *tsk, + unsigned long *flags) +{ + struct sighand_struct *ret; + + ret = __lock_task_sighand(tsk, flags); + (void)__cond_lock(&tsk->sighand->siglock, ret); + return ret; +} static inline void unlock_task_sighand(struct task_struct *tsk, unsigned long *flags)