* [PATCH] x86/xen: Fix a -Wmissing prototypes warning for xen_start_kernel()
@ 2020-06-06 14:27 Benjamin Thiel
2020-06-08 19:30 ` Boris Ostrovsky
0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Thiel @ 2020-06-06 14:27 UTC (permalink / raw)
To: Borislav Petkov, Boris Ostrovsky, Juergen Gross
Cc: x86 ML, LKML, Benjamin Thiel
Fix:
arch/x86/xen/enlighten_pv.c:1212:34:
warning: no previous prototype for ‘xen_start_kernel’ [-Wmissing-prototypes]
asmlinkage __visible void __init xen_start_kernel(void)
Add a prototype for xen_start_kernel() in a separate xen-specific header.
Signed-off-by: Benjamin Thiel <b.thiel@posteo.de>
---
arch/x86/include/asm/xen/setup.h | 7 +++++++
arch/x86/xen/enlighten_pv.c | 1 +
2 files changed, 8 insertions(+)
create mode 100644 arch/x86/include/asm/xen/setup.h
diff --git a/arch/x86/include/asm/xen/setup.h b/arch/x86/include/asm/xen/setup.h
new file mode 100644
index 000000000000..b7bd97f4b837
--- /dev/null
+++ b/arch/x86/include/asm/xen/setup.h
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_X86_XEN_SETUP_H
+#define _ASM_X86_XEN_SETUP_H
+
+asmlinkage __visible void __init xen_start_kernel(void);
+
+#endif /*_ASM_X86_XEN_SETUP_H */
diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c
index 35321f4d49f1..dc0850f09c70 100644
--- a/arch/x86/xen/enlighten_pv.c
+++ b/arch/x86/xen/enlighten_pv.c
@@ -55,6 +55,7 @@
#include <asm/xen/hypercall.h>
#include <asm/xen/hypervisor.h>
#include <asm/xen/cpuid.h>
+#include <asm/xen/setup.h>
#include <asm/fixmap.h>
#include <asm/processor.h>
#include <asm/proto.h>
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] x86/xen: Fix a -Wmissing prototypes warning for xen_start_kernel()
2020-06-06 14:27 [PATCH] x86/xen: Fix a -Wmissing prototypes warning for xen_start_kernel() Benjamin Thiel
@ 2020-06-08 19:30 ` Boris Ostrovsky
2020-06-08 19:42 ` Borislav Petkov
0 siblings, 1 reply; 3+ messages in thread
From: Boris Ostrovsky @ 2020-06-08 19:30 UTC (permalink / raw)
To: Benjamin Thiel, Borislav Petkov, Juergen Gross; +Cc: x86 ML, LKML
On 6/6/20 10:27 AM, Benjamin Thiel wrote:
> Fix:
>
> arch/x86/xen/enlighten_pv.c:1212:34:
> warning: no previous prototype for ‘xen_start_kernel’ [-Wmissing-prototypes]
> asmlinkage __visible void __init xen_start_kernel(void)
>
> Add a prototype for xen_start_kernel() in a separate xen-specific header.
TBH I am not sure it's worth a new header file for a routine that is
only called from assembly (and never returns). I'd just add the
prototype right above function definition, with a comment describing
why. I see a few examples of this in the tree. Or maybe we even have an
attribute for this case?
(I also suspect the same may be needed for xen_prepare_pvh() BTW).
-boris
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] x86/xen: Fix a -Wmissing prototypes warning for xen_start_kernel()
2020-06-08 19:30 ` Boris Ostrovsky
@ 2020-06-08 19:42 ` Borislav Petkov
0 siblings, 0 replies; 3+ messages in thread
From: Borislav Petkov @ 2020-06-08 19:42 UTC (permalink / raw)
To: Boris Ostrovsky; +Cc: Benjamin Thiel, Juergen Gross, x86 ML, LKML
On Mon, Jun 08, 2020 at 03:30:13PM -0400, Boris Ostrovsky wrote:
> TBH I am not sure it's worth a new header file for a routine that is
> only called from assembly (and never returns). I'd just add the
> prototype right above function definition, with a comment describing
> why.
Right, that works too.
> I see a few examples of this in the tree. Or maybe we even have an
> attribute for this case?
Not that I'm aware of.
> (I also suspect the same may be needed for xen_prepare_pvh() BTW).
Yeah, Benni is working through the rest of them. Btw, the final goal of
this whole work is to enable -Wmissing-prototypes by default on x86.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-06-08 19:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-06 14:27 [PATCH] x86/xen: Fix a -Wmissing prototypes warning for xen_start_kernel() Benjamin Thiel
2020-06-08 19:30 ` Boris Ostrovsky
2020-06-08 19:42 ` Borislav Petkov
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).