[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1303914395-841373-2-git-send-email-hans.rosenfeld@amd.com>
Date: Wed, 27 Apr 2011 16:26:35 +0200
From: Hans Rosenfeld <hans.rosenfeld@....com>
To: <hpa@...or.com>
CC: <brgerst@...il.com>, <tglx@...utronix.de>, <mingo@...e.hu>,
<suresh.b.siddha@...el.com>, <eranian@...gle.com>,
<robert.richter@....com>, <Andreas.Herrmann3@....com>,
<x86@...nel.org>, <linux-kernel@...r.kernel.org>,
Hans Rosenfeld <hans.rosenfeld@....com>
Subject: [PATCH 2/2] fork: avoid weak function arch_dup_task_struct
Avoid potential gcc bug by not using a weak function for
arch_dup_task_struct. Use an #ifdef'ed static function for
archs that don't have a special arch_dup_task_struct implementation.
Signed-off-by: Hans Rosenfeld <hans.rosenfeld@....com>
---
arch/sh/include/asm/thread_info.h | 1 +
arch/x86/include/asm/thread_info.h | 1 +
kernel/fork.c | 5 +++--
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/sh/include/asm/thread_info.h b/arch/sh/include/asm/thread_info.h
index ea2d508..2d27e1c 100644
--- a/arch/sh/include/asm/thread_info.h
+++ b/arch/sh/include/asm/thread_info.h
@@ -100,6 +100,7 @@ extern void free_thread_info(struct thread_info *ti);
extern void arch_task_cache_init(void);
#define arch_task_cache_init arch_task_cache_init
extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
+#define arch_dup_task_struct arch_dup_task_struct
extern void init_thread_xstate(void);
#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index 07c8cfe..ce97947 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -266,6 +266,7 @@ extern void arch_task_cache_init(void);
extern void free_thread_info(struct thread_info *ti);
extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
extern int arch_prealloc_fpu(struct task_struct *tsk);
+#define arch_dup_task_struct arch_dup_task_struct
#define arch_prealloc_fpu arch_prealloc_fpu
#define arch_task_cache_init arch_task_cache_init
#endif
diff --git a/kernel/fork.c b/kernel/fork.c
index e7548de..6d929d0 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -243,12 +243,13 @@ void __init fork_init(unsigned long mempages)
init_task.signal->rlim[RLIMIT_NPROC];
}
-int __attribute__((weak)) arch_dup_task_struct(struct task_struct *dst,
- struct task_struct *src)
+#ifndef arch_dup_task_struct
+static int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
{
*dst = *src;
return 0;
}
+#endif
static struct task_struct *dup_task_struct(struct task_struct *orig)
{
--
1.5.6.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists