Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mshv: hide x86-specific functions on arm64

The hv_sleep_notifiers_register() and hv_machine_power_off() functions are
only called and declared on x86, but cause a warning on arm64:

drivers/hv/mshv_common.c:210:6: error: no previous prototype for 'hv_sleep_notifiers_register' [-Werror=missing-prototypes]
210 | void hv_sleep_notifiers_register(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hv/mshv_common.c:224:6: error: no previous prototype for 'hv_machine_power_off' [-Werror=missing-prototypes]
224 | void hv_machine_power_off(void)
| ^~~~~~~~~~~~~~~~~~~~

Hide both inside of an #ifdef block.

Fixes: f0be2600ac55 ("mshv: Use reboot notifier to configure sleep state")
Fixes: 615a6e7d83f9 ("mshv: Cleanly shutdown root partition with MSHV")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Wei Liu <wei.liu@kernel.org>

authored by

Arnd Bergmann and committed by
Wei Liu
92c172ae beb15a60

+2
+2
drivers/hv/mshv_common.c
··· 142 142 } 143 143 EXPORT_SYMBOL_GPL(hv_call_get_partition_property); 144 144 145 + #ifdef CONFIG_X86 145 146 /* 146 147 * Corresponding sleep states have to be initialized in order for a subsequent 147 148 * HVCALL_ENTER_SLEEP_STATE call to succeed. Currently only S5 state as per ··· 238 237 BUG(); 239 238 240 239 } 240 + #endif