Messages in this thread Patch in this message | | | Date | Mon, 26 Jan 2009 18:28:02 +0300 | From | Cyrill Gorcunov <> | 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
| |