[PATCH 3/3 v9] kexec: Fix i386 build warnings that missed declaration of struct kimage

From: Lianbo Jiang
Date: Fri Nov 08 2019 - 04:01:17 EST


Kbuild test robot reported some build warnings as follow:

arch/x86/include/asm/crash.h:5:32: warning: 'struct kimage' declared
inside parameter list will not be visible outside of this definition
or declaration
int crash_load_segments(struct kimage *image);
^~~~~~
int crash_copy_backup_region(struct kimage *image);
^~~~~~
int crash_setup_memmap_entries(struct kimage *image,
^~~~~~
The 'struct kimage' is defined in the header file include/linux/kexec.h,
before using it, need to include its header file or make a declaration.
Otherwise the above warnings may be triggered.

Add a declaration of struct kimage to the file arch/x86/include/asm/
crash.h, that will solve these compile warnings.

Fixes: dd5f726076cc ("kexec: support for kexec on panic using new system call")
Reported-by: kbuild test robot <lkp@xxxxxxxxx>
Signed-off-by: Lianbo Jiang <lijiang@xxxxxxxxxx>
Link: https://lkml.kernel.org/r/201910310233.EJRtTMWP%25lkp@xxxxxxxxx
---
arch/x86/include/asm/crash.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/x86/include/asm/crash.h b/arch/x86/include/asm/crash.h
index 3dff55f4ed9d..88eadd08ad70 100644
--- a/arch/x86/include/asm/crash.h
+++ b/arch/x86/include/asm/crash.h
@@ -2,6 +2,8 @@
#ifndef _ASM_X86_CRASH_H
#define _ASM_X86_CRASH_H

+struct kimage;
+
int crash_load_segments(struct kimage *image);
int crash_copy_backup_region(struct kimage *image);
int crash_setup_memmap_entries(struct kimage *image,
--
2.17.1