Re: [patch 1/3] x86, bts: clear bts bits on fork

From: Ingo Molnar
Date: Tue Dec 16 2008 - 12:18:25 EST



* Markus Metzger <markus.t.metzger@xxxxxxxxx> wrote:

> -#ifdef CONFIG_X86_DS
> +#ifdef CONFIG_X86_PTRACE_BTS
> /* Free any BTS tracers that have not been properly released. */
> if (unlikely(current->bts)) {
> ds_release_bts(current->bts);
> @@ -258,7 +258,7 @@
> current->bts_buffer = NULL;
> current->bts_size = 0;
> }
> -#endif /* CONFIG_X86_DS */

Please eliminate the #ifdef from here by introducing a helper function -
possibly inlined.

> +#ifdef CONFIG_X86_DS
> + clear_tsk_thread_flag(p, TIF_DS_AREA_MSR);
> + p->thread.ds_ctx = NULL;
> +#endif
> +#ifdef CONFIG_X86_PTRACE_BTS
> + p->thread.bts_ovfl_signal = 0;
> +#endif

ditto.

> +#ifdef CONFIG_X86_PTRACE_BTS
> + p->bts = NULL;
> + p->bts_buffer = NULL;
> + p->bts_size = 0;
> +#endif

this one too please.

There's generally little reason to put #ifdefs into .c files.

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