Skip to content

Commit bab0d47

Browse files
xhackerustcpalmer-dabbelt
authored andcommitted
riscv: kexec: Fix W=1 build warnings
Fixes the following W=1 build warning(s): In file included from include/linux/kexec.h:28, from arch/riscv/kernel/machine_kexec.c:7: arch/riscv/include/asm/kexec.h:45:1: warning: ‘extern’ is not at beginning of declaration [-Wold-style-declaration] 45 | const extern unsigned char riscv_kexec_relocate[]; | ^~~~~ arch/riscv/include/asm/kexec.h:46:1: warning: ‘extern’ is not at beginning of declaration [-Wold-style-declaration] 46 | const extern unsigned int riscv_kexec_relocate_size; | ^~~~~ arch/riscv/kernel/machine_kexec.c:125:6: warning: no previous prototype for ‘machine_shutdown’ [-Wmissing-prototypes] 125 | void machine_shutdown(void) | ^~~~~~~~~~~~~~~~ arch/riscv/kernel/machine_kexec.c:147:1: warning: no previous prototype for ‘machine_crash_shutdown’ [-Wmissing-prototypes] 147 | machine_crash_shutdown(struct pt_regs *regs) | ^~~~~~~~~~~~~~~~~~~~~~ arch/riscv/kernel/machine_kexec.c:23: warning: Function parameter or member 'image' not described in 'kexec_image_info' arch/riscv/kernel/machine_kexec.c:53: warning: Function parameter or member 'image' not described in 'machine_kexec_prepare' arch/riscv/kernel/machine_kexec.c:114: warning: Function parameter or member 'image' not described in 'machine_kexec_cleanup' arch/riscv/kernel/machine_kexec.c:148: warning: Function parameter or member 'regs' not described in 'machine_crash_shutdown' arch/riscv/kernel/machine_kexec.c:167: warning: Function parameter or member 'image' not described in 'machine_kexec' Signed-off-by: Jisheng Zhang <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 02ccdee commit bab0d47

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

arch/riscv/include/asm/kexec.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ struct kimage_arch {
4242
unsigned long fdt_addr;
4343
};
4444

45-
const extern unsigned char riscv_kexec_relocate[];
46-
const extern unsigned int riscv_kexec_relocate_size;
45+
extern const unsigned char riscv_kexec_relocate[];
46+
extern const unsigned int riscv_kexec_relocate_size;
4747

4848
typedef void (*riscv_kexec_method)(unsigned long first_ind_entry,
4949
unsigned long jump_addr,

arch/riscv/kernel/machine_kexec.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
#include <asm/set_memory.h> /* For set_memory_x() */
1515
#include <linux/compiler.h> /* For unreachable() */
1616
#include <linux/cpu.h> /* For cpu_down() */
17+
#include <linux/reboot.h>
1718

18-
/**
19+
/*
1920
* kexec_image_info - Print received image details
2021
*/
2122
static void
@@ -39,7 +40,7 @@ kexec_image_info(const struct kimage *image)
3940
}
4041
}
4142

42-
/**
43+
/*
4344
* machine_kexec_prepare - Initialize kexec
4445
*
4546
* This function is called from do_kexec_load, when the user has
@@ -100,7 +101,7 @@ machine_kexec_prepare(struct kimage *image)
100101
}
101102

102103

103-
/**
104+
/*
104105
* machine_kexec_cleanup - Cleanup any leftovers from
105106
* machine_kexec_prepare
106107
*
@@ -135,7 +136,7 @@ void machine_shutdown(void)
135136
#endif
136137
}
137138

138-
/**
139+
/*
139140
* machine_crash_shutdown - Prepare to kexec after a kernel crash
140141
*
141142
* This function is called by crash_kexec just before machine_kexec
@@ -151,7 +152,7 @@ machine_crash_shutdown(struct pt_regs *regs)
151152
pr_info("Starting crashdump kernel...\n");
152153
}
153154

154-
/**
155+
/*
155156
* machine_kexec - Jump to the loaded kimage
156157
*
157158
* This function is called by kernel_kexec which is called by the

0 commit comments

Comments
 (0)