All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v6 5/8] xen/spinlock: let all is_locked and trylock variants return bool
Date: Wed, 27 Mar 2024 16:22:26 +0100	[thread overview]
Message-ID: <20240327152229.25847-6-jgross@suse.com> (raw)
In-Reply-To: <20240327152229.25847-1-jgross@suse.com>

Switch the remaining trylock and is_locked variants to return bool.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
V5:
- new patch (Jan Beulich)
---
 xen/common/spinlock.c      | 4 ++--
 xen/include/xen/spinlock.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c
index 5aaca49a61..7ccb725171 100644
--- a/xen/common/spinlock.c
+++ b/xen/common/spinlock.c
@@ -393,7 +393,7 @@ static bool always_inline spin_is_locked_common(const spinlock_tickets_t *t)
     return t->head != t->tail;
 }
 
-int _spin_is_locked(const spinlock_t *lock)
+bool _spin_is_locked(const spinlock_t *lock)
 {
     /*
      * This function is suitable only for use in ASSERT()s and alike, as it
@@ -433,7 +433,7 @@ static bool always_inline spin_trylock_common(spinlock_tickets_t *t,
     return true;
 }
 
-int _spin_trylock(spinlock_t *lock)
+bool _spin_trylock(spinlock_t *lock)
 {
     return spin_trylock_common(&lock->tickets, &lock->debug, LOCK_PROFILE_PAR);
 }
diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h
index f49ba928f0..3a4092626c 100644
--- a/xen/include/xen/spinlock.h
+++ b/xen/include/xen/spinlock.h
@@ -234,8 +234,8 @@ void _spin_unlock(spinlock_t *lock);
 void _spin_unlock_irq(spinlock_t *lock);
 void _spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags);
 
-int _spin_is_locked(const spinlock_t *lock);
-int _spin_trylock(spinlock_t *lock);
+bool _spin_is_locked(const spinlock_t *lock);
+bool _spin_trylock(spinlock_t *lock);
 void _spin_barrier(spinlock_t *lock);
 
 static always_inline void spin_lock(spinlock_t *l)
-- 
2.35.3



  parent reply	other threads:[~2024-03-27 15:23 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-27 15:22 [PATCH v6 0/8] xen/spinlock: make recursive spinlocks a dedicated type Juergen Gross
2024-03-27 15:22 ` [PATCH v6 1/8] xen/spinlock: add explicit non-recursive locking functions Juergen Gross
2024-04-04 11:22   ` Juergen Gross
2024-04-04 11:36     ` Michal Orzel
2024-03-27 15:22 ` [PATCH v6 2/8] xen/spinlock: add another function level Juergen Gross
2024-03-27 15:22 ` [PATCH v6 3/8] xen/spinlock: add missing rspin_is_locked() and rspin_barrier() Juergen Gross
2024-04-02 14:37   ` Jan Beulich
2024-03-27 15:22 ` [PATCH v6 4/8] xen/spinlock: split recursive spinlocks from normal ones Juergen Gross
2024-03-27 15:22 ` Juergen Gross [this message]
2024-03-27 15:22 ` [PATCH v6 6/8] xen/spinlock: support higher number of cpus Juergen Gross
2024-04-02 14:42   ` Jan Beulich
2024-04-02 15:10     ` Jürgen Groß
2024-03-27 15:22 ` [PATCH v6 7/8] xen/rwlock: raise the number of possible cpus Juergen Gross
2024-04-02 14:52   ` Jan Beulich
2024-04-02 15:29     ` Jürgen Groß
2024-04-03  6:05       ` Jan Beulich
2024-03-27 15:22 ` [PATCH v6 8/8] xen: allow up to 16383 cpus Juergen Gross
2024-04-08  7:10   ` Jan Beulich
2024-04-29 10:33     ` Juergen Gross
2024-04-29 11:04       ` Julien Grall
2024-04-29 11:28         ` Jürgen Groß
2024-04-29 17:12           ` Julien Grall
2024-05-02 18:13             ` Stefano Stabellini
2024-05-03  9:39               ` Julien Grall
2024-05-03 19:07                 ` Stefano Stabellini
2024-05-06  6:42                   ` Jan Beulich
2024-05-06  6:53                     ` Juergen Gross
2024-05-07 13:12                     ` Julien Grall
2024-05-07 13:08                   ` Julien Grall
2024-05-08  0:31                     ` Stefano Stabellini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240327152229.25847-6-jgross@suse.com \
    --to=jgross@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.