Messages in this thread Patch in this message | | | From | Peter Chubb <> | Date | Tue, 16 Apr 2002 08:24:57 +1000 | Subject | Remove 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/
| |