]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
locking: Various static lock initializer fixes
authorThomas Gleixner <tglx@linutronix.de>
Sun, 17 Jul 2011 19:25:03 +0000 (21:25 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 19 Feb 2013 07:42:45 +0000 (08:42 +0100)
The static lock initializers want to be fed the proper name of the
lock and not some random string. In mainline random strings are
obfuscating the readability of debug output, but for RT they prevent
the spinlock substitution. Fix it up.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/char/random.c
drivers/usb/chipidea/debug.c
fs/file.c
include/linux/idr.h

index 85e81ec1451e38accca94d8dee9d4703ff614063..594bda9dcfc8ef847b725f44b3bd2604a784375a 100644 (file)
@@ -445,7 +445,7 @@ static struct entropy_store input_pool = {
        .poolinfo = &poolinfo_table[0],
        .name = "input",
        .limit = 1,
-       .lock = __SPIN_LOCK_UNLOCKED(&input_pool.lock),
+       .lock = __SPIN_LOCK_UNLOCKED(input_pool.lock),
        .pool = input_pool_data
 };
 
@@ -454,7 +454,7 @@ static struct entropy_store blocking_pool = {
        .name = "blocking",
        .limit = 1,
        .pull = &input_pool,
-       .lock = __SPIN_LOCK_UNLOCKED(&blocking_pool.lock),
+       .lock = __SPIN_LOCK_UNLOCKED(blocking_pool.lock),
        .pool = blocking_pool_data
 };
 
@@ -462,7 +462,7 @@ static struct entropy_store nonblocking_pool = {
        .poolinfo = &poolinfo_table[1],
        .name = "nonblocking",
        .pull = &input_pool,
-       .lock = __SPIN_LOCK_UNLOCKED(&nonblocking_pool.lock),
+       .lock = __SPIN_LOCK_UNLOCKED(nonblocking_pool.lock),
        .pool = nonblocking_pool_data
 };
 
index 3bc244d2636ab9c7d0f1b9281de6e318715dcd29..a62c4a47d52c6685787ff01e174f67040241502f 100644 (file)
@@ -222,7 +222,7 @@ static struct {
 } dbg_data = {
        .idx = 0,
        .tty = 0,
-       .lck = __RW_LOCK_UNLOCKED(lck)
+       .lck = __RW_LOCK_UNLOCKED(dbg_data.lck)
 };
 
 /**
index 2b3570b7caeba28bab8df3a4598fbdfc75fdcfc7..3906d9577a18e94062a698d54035c7b7614f524e 100644 (file)
--- a/fs/file.c
+++ b/fs/file.c
@@ -516,7 +516,7 @@ struct files_struct init_files = {
                .close_on_exec  = init_files.close_on_exec_init,
                .open_fds       = init_files.open_fds_init,
        },
-       .file_lock      = __SPIN_LOCK_UNLOCKED(init_task.file_lock),
+       .file_lock      = __SPIN_LOCK_UNLOCKED(init_files.file_lock),
 };
 
 /*
index de7e190f1af4ea7d7b596a3a224e40ccbc7a6a44..e5eb125effe6ce4f7856313a9cdd57aa642e6897 100644 (file)
@@ -136,7 +136,7 @@ struct ida {
        struct ida_bitmap       *free_bitmap;
 };
 
-#define IDA_INIT(name)         { .idr = IDR_INIT(name), .free_bitmap = NULL, }
+#define IDA_INIT(name)         { .idr = IDR_INIT((name).idr), .free_bitmap = NULL, }
 #define DEFINE_IDA(name)       struct ida name = IDA_INIT(name)
 
 int ida_pre_get(struct ida *ida, gfp_t gfp_mask);