[PATCH v6 05/10] x86/virt/tdx: Add missing header file inclusion to local tdx.h

Kai Huang posted 10 patches 3 weeks, 6 days ago
There is a newer version of this series
[PATCH v6 05/10] x86/virt/tdx: Add missing header file inclusion to local tdx.h
Posted by Kai Huang 3 weeks, 6 days ago
Compiler attributes __packed and __aligned, and DECLARE_FLEX_ARRAY() are
currently used in arch/x86/virt/vmx/tdx/tdx.h, but the relevant headers
are not included explicitly.

There's no build issue in the current code since this "tdx.h" is only
included by arch/x86/virt/vmx/tdx/tdx.c and it includes bunch of other
<linux/xxx.h> before including "tdx.h".  But for the better explicitly
include the relevant headers to "tdx.h".  Also include <linux/types.h>
for basic variable types like u16.

Signed-off-by: Kai Huang <kai.huang@intel.com>
---
 arch/x86/virt/vmx/tdx/tdx.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/virt/vmx/tdx/tdx.h b/arch/x86/virt/vmx/tdx/tdx.h
index ec879d54eb5c..b1d705c3ab2a 100644
--- a/arch/x86/virt/vmx/tdx/tdx.h
+++ b/arch/x86/virt/vmx/tdx/tdx.h
@@ -2,6 +2,9 @@
 #ifndef _X86_VIRT_TDX_H
 #define _X86_VIRT_TDX_H
 
+#include <linux/types.h>
+#include <linux/compiler_attributes.h>
+#include <linux/stddef.h>
 #include <linux/bits.h>
 
 /*
-- 
2.46.2
Re: [PATCH v6 05/10] x86/virt/tdx: Add missing header file inclusion to local tdx.h
Posted by Dan Williams 3 weeks, 6 days ago
Kai Huang wrote:
> Compiler attributes __packed and __aligned, and DECLARE_FLEX_ARRAY() are
> currently used in arch/x86/virt/vmx/tdx/tdx.h, but the relevant headers
> are not included explicitly.
> 
> There's no build issue in the current code since this "tdx.h" is only
> included by arch/x86/virt/vmx/tdx/tdx.c and it includes bunch of other
> <linux/xxx.h> before including "tdx.h".  But for the better explicitly
> include the relevant headers to "tdx.h".  Also include <linux/types.h>
> for basic variable types like u16.
> 
> Signed-off-by: Kai Huang <kai.huang@intel.com>

Makes sense

Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Re: [PATCH v6 05/10] x86/virt/tdx: Add missing header file inclusion to local tdx.h
Posted by Nikolay Borisov 3 weeks, 6 days ago

On 28.10.24 г. 14:41 ч., Kai Huang wrote:
> Compiler attributes __packed and __aligned, and DECLARE_FLEX_ARRAY() are
> currently used in arch/x86/virt/vmx/tdx/tdx.h, but the relevant headers
> are not included explicitly.
> 
> There's no build issue in the current code since this "tdx.h" is only
> included by arch/x86/virt/vmx/tdx/tdx.c and it includes bunch of other
> <linux/xxx.h> before including "tdx.h".  But for the better explicitly
> include the relevant headers to "tdx.h".  Also include <linux/types.h>
> for basic variable types like u16.
> 
> Signed-off-by: Kai Huang <kai.huang@intel.com>

Reviewed-by: Nikolay Borisov <nik.borisov@suse.com>