On 2026-02-20 22:46, Andrew Cooper wrote:
Eclair complains of a side effect in a sizeof() expression (R13.6).
write_atomic() only evaluates each parameter once, but rewrite the
expression
to less resemble entries in an obfuscation contest.
No functional change.
Signed-off-by: Andrew Cooper <[email protected]>
Reviewed-by: Nicola Vetrini <[email protected]>
---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>
CC: Volodymyr Babchuk <[email protected]>
CC: Bertrand Marquis <[email protected]>
CC: Michal Orzel <[email protected]>
CC: [email protected] <[email protected]>
CC: Nicola Vetrini <[email protected]>
---
xen/arch/x86/mm/shadow/set.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/xen/arch/x86/mm/shadow/set.c
b/xen/arch/x86/mm/shadow/set.c
index 8b670b6bb555..96ba2811077e 100644
--- a/xen/arch/x86/mm/shadow/set.c
+++ b/xen/arch/x86/mm/shadow/set.c
@@ -62,8 +62,8 @@ shadow_write_entries(void *d, const void *s, unsigned
int entries, mfn_t mfn)
ASSERT(IS_ALIGNED((unsigned long)dst, sizeof(*dst)));
- for ( ; i < entries; i++ )
- write_atomic(&dst++->l1, src++->l1);
+ for ( ; i < entries; i++, dst++, src++ )
+ write_atomic(&dst->l1, src->l1);
unmap_domain_page(map);
}
--
Nicola Vetrini, B.Sc.
Software Engineer
BUGSENG (https://bugseng.com)
LinkedIn: https://www.linkedin.com/in/nicola-vetrini-a42471253