From fff00f1826d878f41aa55e9ebd78f6b210a72996 Mon Sep 17 00:00:00 2001 From: Roger Pau Monne Date: Wed, 2 Sep 2026 14:52:34 +0200 Subject: [PATCH] xen/rcu: fix types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adjust some types: int -> bool, int -> unsigned int. Also fix a couple of typos plus trailing white space. No functional change intended. Signed-off-by: Roger Pau Monné Acked-by: Andrew Cooper --- xen/common/rcupdate.c | 12 ++++++------ xen/include/xen/rcupdate.h | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/xen/common/rcupdate.c b/xen/common/rcupdate.c index fd5d3d7484..3b96f829c8 100644 --- a/xen/common/rcupdate.c +++ b/xen/common/rcupdate.c @@ -509,18 +509,18 @@ static int __rcu_pending(struct rcu_ctrlblk *rcp, struct rcu_data *rdp) return 0; } -int rcu_pending(int cpu) +bool rcu_pending(unsigned int cpu) { - return __rcu_pending(&rcu_ctrlblk, &per_cpu(rcu_data, cpu)); + return !!__rcu_pending(&rcu_ctrlblk, &per_cpu(rcu_data, cpu)); } /* * Check to see if any future RCU-related work will need to be done * by the current CPU, even if none need be done immediately, returning - * 1 if so. This function is part of the RCU implementation; it is -not- + * true if so. This function is part of the RCU implementation; it is -not- * an exported member of the RCU API. */ -int rcu_needs_cpu(int cpu) +bool rcu_needs_cpu(unsigned int cpu) { struct rcu_data *rdp = &per_cpu(rcu_data, cpu); @@ -529,7 +529,7 @@ int rcu_needs_cpu(int cpu) /* * Timer for making sure the CPU where a callback is queued does - * periodically poke rcu_pedning(), so that it will invoke the callback + * periodically poke rcu_pending(), so that it will invoke the callback * not too late after the end of the grace period. */ static void rcu_idle_timer_start(void) @@ -588,7 +588,7 @@ static void cf_check rcu_idle_timer_handler(void* data) IDLE_TIMER_PERIOD_MIN); } -void rcu_check_callbacks(int cpu) +void rcu_check_callbacks(unsigned int cpu) { struct rcu_data *rdp = &this_cpu(rcu_data); diff --git a/xen/include/xen/rcupdate.h b/xen/include/xen/rcupdate.h index 95f4ad81c4..c57f628107 100644 --- a/xen/include/xen/rcupdate.h +++ b/xen/include/xen/rcupdate.h @@ -77,8 +77,8 @@ struct rcu_head { } while (0) -int rcu_pending(int cpu); -int rcu_needs_cpu(int cpu); +bool rcu_pending(unsigned int cpu); +bool rcu_needs_cpu(unsigned int cpu); /* * Dummy lock type for passing to rcu_read_{lock,unlock}. Currently exists @@ -168,10 +168,10 @@ static inline void rcu_read_unlock(rcu_read_lock_t *lock) #define rcu_assign_pointer(p, v) ({ smp_wmb(); (p) = (v); }) void rcu_init(void); -void rcu_check_callbacks(int cpu); +void rcu_check_callbacks(unsigned int cpu); /* Exported interfaces */ -void call_rcu(struct rcu_head *head, +void call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *head)); void rcu_barrier(void);