From 0969fc9fa121a19a7ad7e1c286a22029d3cbecf4 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Wed, 1 Jul 2026 14:14:30 +0200 Subject: [PATCH] domain: domlist_update_lock can be static For a long time (if not forever) this lock has been referenced only from a single CU. Misra C:2012 rule 8.7 (which we didn't accept yet) wants us to have such identifiers non-external. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper Reviewed-by: Oleksii Kurochko --- xen/common/domain.c | 2 +- xen/include/xen/sched.h | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/xen/common/domain.c b/xen/common/domain.c index 8f2bfcae28..53ac1d6c40 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -58,7 +58,7 @@ bool opt_dom0_vcpus_pin; boolean_param("dom0_vcpus_pin", opt_dom0_vcpus_pin); /* Protect updates/reads (resp.) of domain_list and domain_hash. */ -DEFINE_SPINLOCK(domlist_update_lock); +static DEFINE_SPINLOCK(domlist_update_lock); DEFINE_RCU_READ_LOCK(domlist_read_lock); #define DOMAIN_HASH_SIZE 256 diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index 91f6db7a32..011292e9f7 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -697,8 +697,10 @@ static inline unsigned int domain_tot_pages(const struct domain *d) return d->tot_pages - d->extra_pages; } -/* Protect updates/reads (resp.) of domain_list and domain_hash. */ -extern spinlock_t domlist_update_lock; +/* + * Protect updates/reads (resp.) of domain_list and domain_hash, together with + * domlist_update_lock. + */ extern rcu_read_lock_t domlist_read_lock; extern struct vcpu *idle_vcpu[NR_CPUS];