[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <152261544964.30503.6618621118546753722.stgit@warthog.procyon.org.uk>
Date: Sun, 01 Apr 2018 21:44:09 +0100
From: David Howells <dhowells@...hat.com>
To: linux-kernel@...r.kernel.org
Subject: [PATCH 39/45] C++: Fix spinlock initialisation
Fix a couple of bits of spinlock initialisation:
(1) owner_cpu is unsigned: set to UINT_MAX rather than -1.
(2) Don't need to cast the result of __SPIN_LOCK_INITIALIZER().
Signed-off-by: David Howells <dhowells@...hat.com>
---
include/linux/spinlock_types.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/spinlock_types.h b/include/linux/spinlock_types.h
index 24b4e6f2c1a2..d1ab81ee85fd 100644
--- a/include/linux/spinlock_types.h
+++ b/include/linux/spinlock_types.h
@@ -41,7 +41,7 @@ typedef struct raw_spinlock {
#ifdef CONFIG_DEBUG_SPINLOCK
# define SPIN_DEBUG_INIT(lockname) \
.magic = SPINLOCK_MAGIC, \
- .owner_cpu = -1, \
+ .owner_cpu = UINT_MAX, \
.owner = SPINLOCK_OWNER_INIT,
#else
# define SPIN_DEBUG_INIT(lockname)
@@ -76,7 +76,7 @@ typedef struct spinlock {
{ { .rlock = __RAW_SPIN_LOCK_INITIALIZER(lockname) } }
#define __SPIN_LOCK_UNLOCKED(lockname) \
- (spinlock_t ) __SPIN_LOCK_INITIALIZER(lockname)
+ __SPIN_LOCK_INITIALIZER(lockname)
#define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x)
Powered by blists - more mailing lists