tdx_hcall_get_quote() takes a "u8 *" buffer unnecessarily. It is never used as such, since only the buffer's memory address matters. Accept a "void *" buffer instead. This avoids a cast to "u8 *" when a later change gives the guest driver's Quote buffer an explicit type. AI was used under supervision to collect/apply feedback, review code and workshop logs. Signed-off-by: Peter Fang Reviewed-by: Kuppuswamy Sathyanarayanan --- v6: - No code changes. - Explain the connection to the explicit Quote buffer type. [Rick] - Add Sathya's Reviewed-by. v5: - New patch. Prepare for a typed Quote buffer. [Dave] --- arch/x86/coco/tdx/tdx.c | 2 +- arch/x86/include/asm/tdx.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/coco/tdx/tdx.c b/arch/x86/coco/tdx/tdx.c index a38e44401840..92c243851171 100644 --- a/arch/x86/coco/tdx/tdx.c +++ b/arch/x86/coco/tdx/tdx.c @@ -191,7 +191,7 @@ EXPORT_SYMBOL_FOR_MODULES(tdx_mcall_extend_rtmr, "tdx-guest"); * * Return 0 on success or error code on failure. */ -u64 tdx_hcall_get_quote(u8 *buf, size_t size) +u64 tdx_hcall_get_quote(void *buf, size_t size) { /* Since buf is a shared memory, set the shared (decrypted) bits */ return _tdx_hypercall(TDVMCALL_GET_QUOTE, cc_mkdec(virt_to_phys(buf)), size, 0, 0); diff --git a/arch/x86/include/asm/tdx.h b/arch/x86/include/asm/tdx.h index e186dfe5bf88..97bf6c8e0d89 100644 --- a/arch/x86/include/asm/tdx.h +++ b/arch/x86/include/asm/tdx.h @@ -82,7 +82,7 @@ int tdx_mcall_get_report0(u8 *reportdata, u8 *tdreport); int tdx_mcall_extend_rtmr(u8 index, u8 *data); -u64 tdx_hcall_get_quote(u8 *buf, size_t size); +u64 tdx_hcall_get_quote(void *buf, size_t size); void __init tdx_dump_attributes(u64 td_attr); void __init tdx_dump_td_ctls(u64 td_ctls); -- 2.53.0