Re: [PATCH -tip] x86: ftrace - simplify wait_for_nmi

From: Steven Rostedt
Date: Mon Jan 26 2009 - 10:42:17 EST



On Mon, 26 Jan 2009, Cyrill Gorcunov wrote:

> Get rid of 'waited' stack variable.
>
> Signed-off-by: Cyrill Gorcunov <gorcunov@xxxxxxxxx>

Thanks Cyrill,

Either I or Ingo will pull it in.

-- Steve

> ---
> 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
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/