linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fork: Fix two -Wmissing-prototypes warnings
@ 2018-11-13  7:26 Yi Wang
  2018-11-13 10:26 ` Rasmus Villemoes
  0 siblings, 1 reply; 2+ messages in thread
From: Yi Wang @ 2018-11-13  7:26 UTC (permalink / raw)
  To: tglx
  Cc: mingo, bp, hpa, x86, keescook, luto, wad, konrad.wilk, wang.yi59,
	dhowells, linux-kernel, riel, viro, zhong.weidong

We get two warning when building kernel with W=1:
kernel/fork.c:167:13: warning: no previous prototype for ‘arch_release_thread_stack’ [-Wmissing-prototypes]
kernel/fork.c:779:13: warning: no previous prototype for ‘fork_init’ [-Wmissing-prototypes]

Add the missing declaration in head file to fix this.

Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
---
 arch/x86/include/asm/thread_info.h | 1 +
 include/linux/sched/task.h         | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index 2ff2a30..8621036 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -237,6 +237,7 @@ static inline int arch_within_stack_frames(const void * const stack,
 extern void arch_task_cache_init(void);
 extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
 extern void arch_release_task_struct(struct task_struct *tsk);
+extern void arch_release_thread_stack(unsigned long *stack);
 extern void arch_setup_new_exec(void);
 #define arch_setup_new_exec arch_setup_new_exec
 #endif	/* !__ASSEMBLY__ */
diff --git a/include/linux/sched/task.h b/include/linux/sched/task.h
index 108ede9..44c6f15 100644
--- a/include/linux/sched/task.h
+++ b/include/linux/sched/task.h
@@ -39,6 +39,8 @@
 
 extern void proc_caches_init(void);
 
+extern void fork_init(void);
+
 extern void release_task(struct task_struct * p);
 
 #ifdef CONFIG_HAVE_COPY_THREAD_TLS
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] fork: Fix two -Wmissing-prototypes warnings
  2018-11-13  7:26 [PATCH] fork: Fix two -Wmissing-prototypes warnings Yi Wang
@ 2018-11-13 10:26 ` Rasmus Villemoes
  0 siblings, 0 replies; 2+ messages in thread
From: Rasmus Villemoes @ 2018-11-13 10:26 UTC (permalink / raw)
  To: Yi Wang, tglx
  Cc: mingo, bp, hpa, x86, keescook, luto, wad, konrad.wilk, dhowells,
	linux-kernel, riel, viro, zhong.weidong

On 13/11/2018 08.26, Yi Wang wrote:
> We get two warning when building kernel with W=1:
> kernel/fork.c:167:13: warning: no previous prototype for ‘arch_release_thread_stack’ [-Wmissing-prototypes]
> kernel/fork.c:779:13: warning: no previous prototype for ‘fork_init’ [-Wmissing-prototypes]

I think you should also remove the "manual" declarations from the .c
files that call the function, in this case fork_init() in  init/main.c;
otherwise there's no guarantee that those translation units actually
include the header that contain the proper declaration.

arch_release_thread_stack can probably just be removed completely after
the recent arch cleanup, since bb9d81264 (arch: remove tile port) no
arch seems to implement it.

Rasmus

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-13 10:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-13  7:26 [PATCH] fork: Fix two -Wmissing-prototypes warnings Yi Wang
2018-11-13 10:26 ` Rasmus Villemoes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).