lkml.org 
[lkml]   [2002]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
SubjectRemove a compilation warning in brlock.c

Hi,
Because the type of brlock_read_lock_t can vary depending on
whether SPINLOCK_DEBUG is defined, I suspect that the initialisation
of __brlock_array in lib/brlock.c is incorrect.

I suspect the initialisation in the __BRLOCK_USE_ATOMICS case whould
be to RW_LOCK_UNLOCKED, not zero. Otherwise, nasty things will happen
-- and wakeups may be missed on i386 (the rwlock_t should be initialised to
-MAXINT-1 for i386, not zero, as the transition from negative->positive
is used to trigger wakeups. Other architectures have other requirements)

--- /tmp/geta28567 Tue Apr 16 08:19:38 2002
+++ linux-2.5/lib/brlock.c Tue Apr 16 08:16:22 2002
@@ -18,7 +18,7 @@
#ifdef __BRLOCK_USE_ATOMICS

brlock_read_lock_t __brlock_array[NR_CPUS][__BR_IDX_MAX] =
- { [0 ... NR_CPUS-1] = { [0 ... __BR_IDX_MAX-1] = {0, 0} } };
+ { [0 ... NR_CPUS-1] = { [0 ... __BR_IDX_MAX-1] = RW_LOCK_UNLOCKED } };

void __br_write_lock (enum brlock_indices idx)
{
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:25    [W:0.025 / U:0.684 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site