Re: [PATCH] __used is needed for function referenced only from inlineasm

From: Geert Uytterhoeven
Date: Mon Nov 24 2008 - 03:57:36 EST


On Mon, 24 Nov 2008, TÃrÃk Edwin wrote:
> According to the gcc manual, the 'used' attribute should be applied to
> functions referenced only from inline assembly.
> This fixes a build failure with llvm-gcc-4.2, which deleted
> __mutex_lock_slowpath, __mutex_unlock_slowpath.
>
> Signed-off-by: TÃrÃk Edwin <edwintorok@xxxxxxxxx>
> ---
> kernel/mutex.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/kernel/mutex.c b/kernel/mutex.c
> index 39a3816..4f45d4b 100644
> --- a/kernel/mutex.c
> +++ b/kernel/mutex.c
> @@ -59,7 +59,7 @@ EXPORT_SYMBOL(__mutex_init);
> * We also put the fastpath first in the kernel image, to make sure the
> * branch is predicted by the CPU as default-untaken.
> */
> -static void noinline __sched
> +static __used noinline void __sched

Perhaps we should incorporate it into `noinline'?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
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/