lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 11 Feb 2012 15:10:36 -0800
From:	tip-bot for Anton Vorontsov <anton.vorontsov@...aro.org>
To:	linux-tip-commits@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, arve@...roid.com,
	anton.vorontsov@...aro.org, hpa@...or.com, mingo@...hat.com,
	peterz@...radead.org, san@...gle.com, ebiederm@...ssion.com,
	paulmck@...ux.vnet.ibm.com, gregkh@...uxfoundation.org,
	ccross@...roid.com, kosaki.motohiro@...il.com, tglx@...utronix.de,
	oleg@...hat.com, mingo@...e.hu
Subject: [tip:sched/core] sched: Turn lock_task_sighand()
  into a static inline

Commit-ID:  9388dc3047a88bedfd867e9ba3e1980c815ac524
Gitweb:     http://git.kernel.org/tip/9388dc3047a88bedfd867e9ba3e1980c815ac524
Author:     Anton Vorontsov <anton.vorontsov@...aro.org>
AuthorDate: Thu, 9 Feb 2012 20:45:19 +0400
Committer:  Ingo Molnar <mingo@...e.hu>
CommitDate: Sat, 11 Feb 2012 15:41:33 +0100

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@...hat.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@...aro.org>
Cc: KOSAKI Motohiro <kosaki.motohiro@...il.com>
Cc: Greg KH <gregkh@...uxfoundation.org>
Cc: Arve <arve@...roid.com>
Cc: San Mehat <san@...gle.com>
Cc: Colin Cross <ccross@...roid.com>
Cc: Eric W. Biederman <ebiederm@...ssion.com>
Cc: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
Cc: kernel-team@...roid.com
Cc: linaro-kernel@...ts.linaro.org
Cc: Peter Zijlstra <peterz@...radead.org>
Link: http://lkml.kernel.org/r/20120209164519.GA10266@oksana.dev.rtsoft.ru
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
 include/linux/sched.h |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 92313a3f..5dba2ad 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)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ