arch/riscv/kernel/machine_kexec.c:126:6: warning: no previous prototype for function 'machine_shutdown'

From: kernel test robot
Date: Sat May 08 2021 - 04:27:45 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dd860052c99b1e088352bdd4fb7aef46f8d2ef47
commit: fba8a8674f68a0628abae470dfcfbcb4a0d7a79e RISC-V: Add kexec support
date: 12 days ago
config: riscv-randconfig-r001-20210508 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 1312852040b3190a6cb7d7c1f61fe95a5e930d8d)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fba8a8674f68a0628abae470dfcfbcb4a0d7a79e
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout fba8a8674f68a0628abae470dfcfbcb4a0d7a79e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=riscv

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> arch/riscv/kernel/machine_kexec.c:126:6: warning: no previous prototype for function 'machine_shutdown' [-Wmissing-prototypes]
void machine_shutdown(void)
^
arch/riscv/kernel/machine_kexec.c:126:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void machine_shutdown(void)
^
static
>> arch/riscv/kernel/machine_kexec.c:148:1: warning: no previous prototype for function 'machine_crash_shutdown' [-Wmissing-prototypes]
machine_crash_shutdown(struct pt_regs *regs)
^
arch/riscv/kernel/machine_kexec.c:147:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void
^
static
2 warnings generated.


vim +/machine_shutdown +126 arch/riscv/kernel/machine_kexec.c

117
118
119 /*
120 * machine_shutdown - Prepare for a kexec reboot
121 *
122 * This function is called by kernel_kexec just before machine_kexec
123 * below. Its goal is to prepare the rest of the system (the other
124 * harts and possibly devices etc) for a kexec reboot.
125 */
> 126 void machine_shutdown(void)
127 {
128 /*
129 * No more interrupts on this hart
130 * until we are back up.
131 */
132 local_irq_disable();
133
134 #if defined(CONFIG_HOTPLUG_CPU)
135 smp_shutdown_nonboot_cpus(smp_processor_id());
136 #endif
137 }
138
139 /**
140 * machine_crash_shutdown - Prepare to kexec after a kernel crash
141 *
142 * This function is called by crash_kexec just before machine_kexec
143 * below and its goal is similar to machine_shutdown, but in case of
144 * a kernel crash. Since we don't handle such cases yet, this function
145 * is empty.
146 */
147 void
> 148 machine_crash_shutdown(struct pt_regs *regs)
149 {
150 }
151

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip