lkml.org 
[lkml]   [2009]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH -tip] x86: ftrace - simplify wait_for_nmi
Get rid of 'waited' stack variable.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
arch/x86/kernel/ftrace.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
Index: linux-2.6.git/arch/x86/kernel/ftrace.c
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/ftrace.c
+++ linux-2.6.git/arch/x86/kernel/ftrace.c
@@ -133,15 +133,14 @@ void ftrace_nmi_exit(void)

static void wait_for_nmi(void)
{
- int waited = 0;
+ if (!atomic_read(&in_nmi))
+ return;

- while (atomic_read(&in_nmi)) {
- waited = 1;
+ do {
cpu_relax();
- }
+ } while(atomic_read(&in_nmi));

- if (waited)
- nmi_wait_count++;
+ nmi_wait_count++;
}

static int

\
 
 \ /
  Last update: 2009-01-26 16:31    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site