From d48b2d347105436365280a3697a265aa4d37e96c Mon Sep 17 00:00:00 2001 From: Dave Hansen Date: Mon, 28 Sep 2026 08:36:00 -0700 Subject: [PATCH] virt: tdx-guest: Remove unused and confusing function argument The tsm_report_ops->report_new() function takes a void* argument for implementations to use. But, TDX does not use the argument. It relies entirely on the 'struct tsm_report'. Despite that, the TDX code passes 'data' around needlessly from tdx_report_new()=>tdx_report_new_locked() where it is completely unused and ignored. This is not just a cleanup or bike-shedding rename. The variable is a real liability because there are 'quote_data' variables and even a tdx_quote_buf->data[] that can get literally referred to as "data". Remove the unused argument. Signed-off-by: Dave Hansen --- drivers/virt/coco/tdx-guest/tdx-guest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/virt/coco/tdx-guest/tdx-guest.c b/drivers/virt/coco/tdx-guest/tdx-guest.c index d0303e31e816..a21bd0376b74 100644 --- a/drivers/virt/coco/tdx-guest/tdx-guest.c +++ b/drivers/virt/coco/tdx-guest/tdx-guest.c @@ -265,7 +265,7 @@ static int wait_for_quote_completion(struct tdx_quote_buf *quote_buf, u32 timeou return (i == timeout) ? -ETIMEDOUT : 0; } -static int tdx_report_new_locked(struct tsm_report *report, void *data) +static int tdx_report_new_locked(struct tsm_report *report) { u8 *buf; struct tdx_quote_buf *quote_buf = quote_data; @@ -333,10 +333,10 @@ static int tdx_report_new_locked(struct tsm_report *report, void *data) return ret; } -static int tdx_report_new(struct tsm_report *report, void *data) +static int tdx_report_new(struct tsm_report *report, void *unused) { scoped_cond_guard(mutex_intr, return -EINTR, "e_lock) - return tdx_report_new_locked(report, data); + return tdx_report_new_locked(report); } static bool tdx_report_attr_visible(int n)