Re: [PATCH] x86: remove unneeded endless loop in BUG()

From: H. Peter Anvin
Date: Thu Feb 19 2009 - 13:44:19 EST


Petr Tesarik wrote:
> Since __builtin_trap() will always generate an illegal instruction, we
> can replace the explicit asm("ud2") with it.
>
> This way gcc will understand that the function never returns, plus it
> won't emit any extra instructions.
>
> Signed-off-by: Petr Tesarik <ptesarik@xxxxxxx>

I like this. Will apply shortly.

-hpa

--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.

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