From 10c22e24a3a490d20dce209099eef8b9858de6d8 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Tue, 6 Oct 2026 08:14:07 +0200 Subject: [PATCH] gnttab: don't cast away constness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While _set_status_v2() indeed doesn't alter the grant_entry_header_t it is handed a pointer to, _set_status_v1() does. Drop the const from the parameter of the latter (and then necessarily also from _set_status()'s), while adding const to the local variable of the former. No functional change. Signed-off-by: Jan Beulich Acked-by: Roger Pau Monné --- xen/common/grant_table.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index 33ef5f651b..c3595e705c 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -740,7 +740,7 @@ static unsigned int nr_grant_entries(struct grant_table *gt) return 0; } -static int _set_status_v1(const grant_entry_header_t *shah, +static int _set_status_v1(grant_entry_header_t *shah, struct domain *rd, struct active_grant_entry *act, int readonly, @@ -832,7 +832,7 @@ static int _set_status_v2(const grant_entry_header_t *shah, domid_t ldomid) { int rc = GNTST_okay; - uint32_t *raw_shah = (uint32_t *)shah; + const uint32_t *raw_shah = (const uint32_t *)shah; union grant_combo scombo; uint16_t mask = GTF_type_mask; @@ -909,7 +909,7 @@ done: } -static int _set_status(const grant_entry_header_t *shah, +static int _set_status(grant_entry_header_t *shah, grant_status_t *status, struct domain *rd, unsigned int rgt_version,