LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, tglx@linutronix.de,
peterz@infradead.org, torvalds@linux-foundation.org,
srostedt@redhat.com
Subject: [PATCH] hardirq.h clean up
Date: Fri, 31 Oct 2008 00:16:56 -0400 (EDT) [thread overview]
Message-ID: <alpine.DEB.1.10.0810310016230.28140@gandalf.stny.rr.com> (raw)
In-Reply-To: <alpine.DEB.1.10.0810310002320.28140@gandalf.stny.rr.com>
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@redhat.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 */
next prev parent reply other threads:[~2008-10-31 4:17 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-30 20:08 [PATCH 0/2] ftrace: handle NMIs safely Steven Rostedt
2008-10-30 20:08 ` [PATCH 1/2] ftrace: nmi safe code modification Steven Rostedt
2008-10-30 20:32 ` Andrew Morton
2008-10-30 20:38 ` Ingo Molnar
2008-10-30 20:58 ` Steven Rostedt
2008-10-30 21:10 ` Andrew Morton
2008-10-31 4:03 ` [PATCH] ftrace: nmi safe code clean ups Steven Rostedt
2008-10-31 4:16 ` Steven Rostedt [this message]
2008-10-31 9:30 ` [PATCH] hardirq.h clean up Ingo Molnar
2008-10-31 13:36 ` [PATCH] ftrace: fix hardirq header for non ftrace archs Steven Rostedt
2008-11-03 10:04 ` Ingo Molnar
2008-10-31 9:28 ` [PATCH] ftrace: nmi safe code clean ups Ingo Molnar
2008-10-30 20:08 ` [PATCH 2/2] ftrace: nmi update statistics Steven Rostedt
2008-10-30 20:38 ` Andrew Morton
2008-10-30 21:14 ` Steven Rostedt
2008-10-30 20:34 ` [PATCH 0/2] ftrace: handle NMIs safely Ingo Molnar
2008-10-30 21:15 ` Steven Rostedt
2008-10-30 22:26 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.1.10.0810310016230.28140@gandalf.stny.rr.com \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=srostedt@redhat.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--subject='Re: [PATCH] hardirq.h clean up' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).