Skip to contentSkip to conversation

rt: fix a build error on locking-selftest.c

PATCH New Frederic Weisbecker 1 participant 1 message Feb 23, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rt: fix a build error on locking-selftest.c

Fix a build error while rt mutexes selftests:

lib/locking-selftest.c: In function ‘dotest’:
lib/locking-selftest.c:951: erreur: incompatible types in initialization lib/locking-selftest.c:1003: erreur: incompatible types in assignment

lock_count is of type atomic_t.

---
 lib/locking-selftest.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
lib/locking-selftest.c +2 -2
index 0732078..9520632 100644
@@ -948,7 +948,7 @@ static void dotest(void (*testcase_fn)(void), int expected, int lockclass_mask)
 	unsigned long saved_preempt_count = preempt_count();
 	int expected_failure = 0;
 #if defined(CONFIG_DEBUG_PREEMPT) && defined(CONFIG_DEBUG_RT_MUTEXES)
-        int saved_lock_count = current->lock_count;
+        int saved_lock_count = atomic_read(&current->lock_count);
 #endif
 
 	WARN_ON(irqs_disabled());
@@ -1000,7 +1000,7 @@ static void dotest(void (*testcase_fn)(void), int expected, int lockclass_mask)
 
 	reset_locks();
 #if defined(CONFIG_DEBUG_PREEMPT) && defined(CONFIG_DEBUG_RT_MUTEXES)
-        current->lock_count = saved_lock_count;
+        atomic_set(&current->lock_count, saved_lock_count);
 #endif
 }
 
Signature · 1 line
1.6.1