[PATCH] x86/tdx: Explicitly include <linux/errno.h> in <asm/tdx.h>

From: Kai Huang
Date: Mon Jun 05 2023 - 23:40:58 EST


Currently, in <asm/tdx.h> tdx_kvm_hypercall() simply returns -ENODEV
when TDX guest isn't enabled in the Kconfig w/o having <linux/errno.h>
header explicitly included. Although the current code doesn't have
build error, in general it is a good practice to explicitly include the
header to make sure any future patch which uses <asm/tdx.h> won't get
build error due to error code not being defined.

Fixes: cfb8ec7a31f2 ("x86/tdx: Wire up KVM hypercalls")
Suggested-by: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
Cc: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@xxxxxxxxxxxxxxx>
Cc: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>
Cc: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
Cc: Isaku Yamahata <isaku.yamahata@xxxxxxxxx>
Signed-off-by: Kai Huang <kai.huang@xxxxxxxxx>
---
arch/x86/include/asm/tdx.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/x86/include/asm/tdx.h b/arch/x86/include/asm/tdx.h
index 28d889c9aa16..0f303c9abee8 100644
--- a/arch/x86/include/asm/tdx.h
+++ b/arch/x86/include/asm/tdx.h
@@ -5,6 +5,7 @@

#include <linux/init.h>
#include <linux/bits.h>
+#include <linux/errno.h>
#include <asm/ptrace.h>
#include <asm/shared/tdx.h>


base-commit: 122333d6bd229af279cdb35d1b874b71b3b9ccfb
--
2.40.1