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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 31 Oct 2008 00:16:56 -0400 (EDT)
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Andrew Morton <akpm@...ux-foundation.org>
cc:	linux-kernel@...r.kernel.org, mingo@...e.hu, tglx@...utronix.de,
	peterz@...radead.org, torvalds@...ux-foundation.org,
	srostedt@...hat.com
Subject: [PATCH] hardirq.h clean up


This patch converts the CPP macros of __irq_enter, __irq_exit,
nmi_enter, and nmi_exit into static inlines.

Signed-off-by: Steven Rostedt <srostedt@...hat.com>
---
 include/linux/hardirq.h |   53 ++++++++++++++++++++++++------------------------
 1 file changed, 27 insertions(+), 26 deletions(-)

Index: linux-tip.git/include/linux/hardirq.h
===================================================================
--- linux-tip.git.orig/include/linux/hardirq.h	2008-10-30 10:27:09.000000000 -0400
+++ linux-tip.git/include/linux/hardirq.h	2008-10-31 00:07:46.000000000 -0400
@@ -133,13 +133,13 @@ extern void rcu_irq_exit(void);
  * always balanced, so the interrupted value of ->hardirq_context
  * will always be restored.
  */
-#define __irq_enter()					\
-	do {						\
-		rcu_irq_enter();			\
-		account_system_vtime(current);		\
-		add_preempt_count(HARDIRQ_OFFSET);	\
-		trace_hardirq_enter();			\
-	} while (0)
+static inline void __irq_enter(void)
+{
+	rcu_irq_enter();
+	account_system_vtime(current);
+	add_preempt_count(HARDIRQ_OFFSET);
+	trace_hardirq_enter();
+}
 
 /*
  * Enter irq context (on NO_HZ, update jiffies):
@@ -149,30 +149,31 @@ extern void irq_enter(void);
 /*
  * Exit irq context without processing softirqs:
  */
-#define __irq_exit()					\
-	do {						\
-		trace_hardirq_exit();			\
-		account_system_vtime(current);		\
-		sub_preempt_count(HARDIRQ_OFFSET);	\
-		rcu_irq_exit();				\
-	} while (0)
+static inline void __irq_exit(void)
+{
+	trace_hardirq_exit();
+	account_system_vtime(current);
+	sub_preempt_count(HARDIRQ_OFFSET);
+	rcu_irq_exit();
+}
 
 /*
  * Exit irq context and process softirqs if needed:
  */
 extern void irq_exit(void);
 
-#define nmi_enter()				\
-	do {					\
-		ftrace_nmi_enter();		\
-		lockdep_off();			\
-		__irq_enter();			\
-	} while (0)
-#define nmi_exit()				\
-	do {					\
-		__irq_exit();			\
-		lockdep_on();			\
-		ftrace_nmi_exit();		\
-	} while (0)
+static inline void nmi_enter(void)
+{
+	ftrace_nmi_enter();
+	lockdep_off();
+	__irq_enter();
+}
+
+static inline void nmi_exit(void)
+{
+	__irq_exit();
+	lockdep_on();
+	ftrace_nmi_exit();
+}
 
 #endif /* LINUX_HARDIRQ_H */


--
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