]> git.itanic.dy.fi Git - linux-stable/commitdiff
x86/hyperv: Add missing 'inline' to hv_snp_boot_ap() stub
authorNathan Chancellor <nathan@kernel.org>
Tue, 22 Aug 2023 18:25:49 +0000 (11:25 -0700)
committerWei Liu <wei.liu@kernel.org>
Wed, 23 Aug 2023 05:41:26 +0000 (05:41 +0000)
When building without CONFIG_AMD_MEM_ENCRYPT, there are several
repeated instances of -Wunused-function due to missing 'inline' on
the stub of hy_snp_boot_ap():

  In file included from drivers/hv/hv_common.c:29:
  ./arch/x86/include/asm/mshyperv.h:272:12: error: 'hv_snp_boot_ap' defined but not used [-Werror=unused-function]
    272 | static int hv_snp_boot_ap(int cpu, unsigned long start_ip) { return 0; }
        |            ^~~~~~~~~~~~~~
  cc1: all warnings being treated as errors

Add 'inline' to fix the warnings.

Fixes: 44676bb9d566 ("x86/hyperv: Add smp support for SEV-SNP guest")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Link: https://lore.kernel.org/r/20230822-hv_snp_boot_ap-missing-inline-v1-1-e712dcb2da0f@kernel.org
arch/x86/include/asm/mshyperv.h

index 6bd9ae04d9c36dea825222d227f97d23aedbf554..b6be267ff3d06e33b1ed771b6e8bd6d42e379627 100644 (file)
@@ -269,7 +269,7 @@ static inline void hv_ghcb_msr_read(u64 msr, u64 *value) {}
 static inline bool hv_ghcb_negotiate_protocol(void) { return false; }
 static inline void hv_ghcb_terminate(unsigned int set, unsigned int reason) {}
 static inline void hv_vtom_init(void) {}
-static int hv_snp_boot_ap(int cpu, unsigned long start_ip) { return 0; }
+static inline int hv_snp_boot_ap(int cpu, unsigned long start_ip) { return 0; }
 #endif
 
 extern bool hv_isolation_type_snp(void);