Re: [PATCH] x86: fix -Wmissing-prototypes warning

From: Ingo Molnar
Date: Thu Nov 22 2018 - 03:48:25 EST



* Yi Wang <wang.yi59@xxxxxxxxxx> wrote:

> We may get -Wmissing-prototypes warnings when building
> kernel with W=1, it's better to fix them as global function
> signature can be changed and caller who use the old unchanged
> prototypes will be hosed.
>
> This patch fixes most of -Wmissing-prototypes warnings which
> are in the root directory of arch/x86/kernel, not including
> the subdirectories.
>
> These are the warnings fixed in this patch:
> arch/x86/kernel/signal.c:865:17: warning: no previous prototype for âsys32_x32_rt_sigreturnâ [-Wmissing-prototypes]
> arch/x86/kernel/signal_compat.c:164:6: warning: no previous prototype for âsigaction_compat_abiâ [-Wmissing-prototypes]
> arch/x86/kernel/traps.c:625:46: warning: no previous prototype for âsync_regsâ [-Wmissing-prototypes]
> arch/x86/kernel/traps.c:640:24: warning: no previous prototype for âfixup_bad_iretâ [-Wmissing-prototypes]
> arch/x86/kernel/traps.c:929:13: warning: no previous prototype for âtrap_initâ [-Wmissing-prototypes]
> arch/x86/kernel/irq.c:270:28: warning: no previous prototype for âsmp_x86_platform_ipiâ [-Wmissing-prototypes]
> arch/x86/kernel/irq.c:301:16: warning: no previous prototype for âsmp_kvm_posted_intr_ipiâ [-Wmissing-prototypes]
> arch/x86/kernel/irq.c:314:16: warning: no previous prototype for âsmp_kvm_posted_intr_wakeup_ipiâ [-Wmissing-prototypes]
> arch/x86/kernel/irq.c:328:16: warning: no previous prototype for âsmp_kvm_posted_intr_nested_ipiâ [-Wmissing-prototypes]
> arch/x86/kernel/irq_work.c:16:28: warning: no previous prototype for âsmp_irq_work_interruptâ [-Wmissing-prototypes]
> arch/x86/kernel/irqinit.c:79:13: warning: no previous prototype for âinit_IRQâ [-Wmissing-prototypes]
> arch/x86/kernel/quirks.c:672:13: warning: no previous prototype for âearly_platform_quirksâ [-Wmissing-prototypes]
> arch/x86/kernel/tsc.c:1499:15: warning: no previous prototype for âcalibrate_delay_is_knownâ [-Wmissing-prototypes]
> arch/x86/kernel/process.c:653:13: warning: no previous prototype for âarch_post_acpi_subsys_initâ [-Wmissing-prototypes]
> arch/x86/kernel/process.c:717:15: warning: no previous prototype for âarch_randomize_brkâ [-Wmissing-prototypes]
> arch/x86/kernel/process.c:784:6: warning: no previous prototype for âdo_arch_prctl_commonâ [-Wmissing-prototypes]
> arch/x86/kernel/reboot.c:869:6: warning: no previous prototype for ânmi_panic_self_stopâ [-Wmissing-prototypes]
> arch/x86/kernel/smp.c:176:27: warning: no previous prototype for âsmp_reboot_interruptâ [-Wmissing-prototypes]
> arch/x86/kernel/smp.c:260:28: warning: no previous prototype for âsmp_reschedule_interruptâ [-Wmissing-prototypes]
> arch/x86/kernel/smp.c:281:28: warning: no previous prototype for âsmp_call_function_interruptâ [-Wmissing-prototypes]
> arch/x86/kernel/smp.c:291:28: warning: no previous prototype for âsmp_call_function_single_interruptâ [-Wmissing-prototypes]
> arch/x86/kernel/ftrace.c:840:6: warning: no previous prototype for âarch_ftrace_update_trampolineâ [-Wmissing-prototypes]
> arch/x86/kernel/ftrace.c:934:7: warning: no previous prototype for âarch_ftrace_trampoline_funcâ [-Wmissing-prototypes]
> arch/x86/kernel/ftrace.c:946:6: warning: no previous prototype for âarch_ftrace_trampoline_freeâ [-Wmissing-prototypes]
> arch/x86/kernel/crash.c:114:6: warning: no previous prototype for âcrash_smp_send_stopâ [-Wmissing-prototypes]
> arch/x86/kernel/crash.c:351:5: warning: no previous prototype for âcrash_setup_memmap_entriesâ [-Wmissing-prototypes]
> arch/x86/kernel/crash.c:424:5: warning: no previous prototype for âcrash_load_segmentsâ [-Wmissing-prototypes]
> arch/x86/kernel/machine_kexec_64.c:372:7: warning: no previous prototype for âarch_kexec_kernel_image_loadâ [-Wmissing-prototypes]
> arch/x86/kernel/paravirt-spinlocks.c:12:16: warning: no previous prototype for â__native_queued_spin_unlockâ [-Wmissing-prototypes]
> arch/x86/kernel/paravirt-spinlocks.c:18:6: warning: no previous prototype for âpv_is_native_spin_unlockâ [-Wmissing-prototypes]
> arch/x86/kernel/paravirt-spinlocks.c:24:16: warning: no previous prototype for â__native_vcpu_is_preemptedâ [-Wmissing-prototypes]
> arch/x86/kernel/paravirt-spinlocks.c:30:6: warning: no previous prototype for âpv_is_native_vcpu_is_preemptedâ [-Wmissing-prototypes]
> arch/x86/kernel/kvm.c:258:1: warning: no previous prototype for âdo_async_page_faultâ [-Wmissing-prototypes]
> arch/x86/kernel/jailhouse.c:200:6: warning: no previous prototype for âjailhouse_paravirtâ [-Wmissing-prototypes]
> arch/x86/kernel/check.c:91:13: warning: no previous prototype for âsetup_bios_corruption_checkâ [-Wmissing-prototypes]
> arch/x86/kernel/check.c:139:6: warning: no previous prototype for âcheck_for_bios_corruptionâ [-Wmissing-prototypes]
> arch/x86/kernel/devicetree.c:32:13: warning: no previous prototype for âearly_init_dt_scan_chosen_archâ [-Wmissing-prototypes]
> arch/x86/kernel/devicetree.c:42:13: warning: no previous prototype for âadd_dtbâ [-Wmissing-prototypes]
> arch/x86/kernel/devicetree.c:108:6: warning: no previous prototype for âx86_of_pci_initâ [-Wmissing-prototypes]
> arch/x86/kernel/devicetree.c:314:13: warning: no previous prototype for âx86_dtb_initâ [-Wmissing-prototypes]
> arch/x86/kernel/tracepoint.c:16:5: warning: no previous prototype for âtrace_pagefault_regâ [-Wmissing-prototypes]
> arch/x86/kernel/tracepoint.c:22:6: warning: no previous prototype for âtrace_pagefault_unregâ [-Wmissing-prototypes]
> arch/x86/kernel/head64.c:113:22: warning: no previous prototype for â__startup_64â [-Wmissing-prototypes]
> arch/x86/kernel/head64.c:262:15: warning: no previous prototype for â__startup_secondary_64â [-Wmissing-prototypes]
> arch/x86/kernel/head64.c:350:12: warning: no previous prototype for âearly_make_pgtableâ [-Wmissing-prototypes]
>
> Signed-off-by: Yi Wang <wang.yi59@xxxxxxxxxx>
> ---
> arch/x86/include/asm/crash.h | 1 +
> arch/x86/include/asm/efi.h | 2 --
> arch/x86/include/asm/irq.h | 7 +++++++
> arch/x86/include/asm/irq_work.h | 1 +
> arch/x86/include/asm/kvm_para.h | 1 +
> arch/x86/include/asm/paravirt.h | 5 +++++
> arch/x86/include/asm/reboot.h | 1 +
> arch/x86/include/asm/setup.h | 5 +++++
> arch/x86/include/asm/sighandling.h | 5 +++++
> arch/x86/include/asm/smp.h | 6 ++++++
> arch/x86/include/asm/traps.h | 4 ++++
> arch/x86/include/asm/tsc.h | 1 +
> arch/x86/kernel/check.c | 3 ++-
> arch/x86/kernel/crash.c | 1 +
> arch/x86/kernel/devicetree.c | 1 +
> arch/x86/kernel/jailhouse.c | 1 +
> arch/x86/kernel/process.c | 3 +++
> arch/x86/kernel/quirks.c | 1 +
> arch/x86/kernel/tracepoint.c | 1 +
> include/linux/efi.h | 2 ++
> include/linux/ftrace.h | 3 +++
> include/linux/kexec.h | 1 +
> include/linux/of_fdt.h | 1 +
> include/linux/ptrace.h | 1 +
> 24 files changed, 55 insertions(+), 3 deletions(-)

Breaks 32-bit compilation:

./arch/x86/include/asm/setup.h: Assembler messages:
./arch/x86/include/asm/setup.h:30: Error: no such instruction: `unsigned long __startup_64(unsigned long physaddr,struct boot_params *bp)'

I'll skip the setup.h bits - let's hope that's the only bug.

Thanks,

Ingo