On Wed, 9 Mar 2005, Andrew Morton wrote:

Russell King <[EMAIL PROTECTED]> wrote:

I'm not convinced about the practicality of converting all static initialisations to code-based initialisations though

This is the first one I recall seeing. All the other conversions were replacing

        static spinlock_t lock = SPIN_LOCK_UNLOCKED;

with
        static DEFINE_SPINLOCK(lock);

and replacing

        {
                lock = SPIN_LOCK_UNLOCKED;
        }

with

        {
                spin_lock_init(lock);
        }

We need to retain the spin_lock_init(&lock) because not all spin-locks are allocated at compile-time. They might be allocated from kmalloc() on startup, probably in a structure, along with other so-called global data.

Cheers,
Dick Johnson
Penguin : Linux version 2.6.10 on an i686 machine (5537.79 BogoMips).
 Notice : All mail here is now cached for review by Dictator Bush.
                 98.36% of all statistics are fiction.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to