]> err.no Git - linux-2.6/commitdiff
dlm: static initialization improvements
authorDenis Cheng <crquan@gmail.com>
Tue, 29 Jan 2008 05:50:16 +0000 (13:50 +0800)
committerDavid Teigland <teigland@redhat.com>
Wed, 30 Jan 2008 17:04:43 +0000 (11:04 -0600)
also change name_prefix from char pointer to char array.

Signed-off-by: Denis Cheng <crquan@gmail.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/user.c

index 1acb4c5813cd2be02308941598f674b696123cee..7cbc6826239b10b5b17b70c0d4f737f7e77152fa 100644 (file)
@@ -24,8 +24,7 @@
 #include "lvb_table.h"
 #include "user.h"
 
-static const char *name_prefix="dlm";
-static struct miscdevice ctl_device;
+static const char name_prefix[] = "dlm";
 static const struct file_operations device_fops;
 
 #ifdef CONFIG_COMPAT
@@ -902,14 +901,16 @@ static const struct file_operations ctl_device_fops = {
        .owner   = THIS_MODULE,
 };
 
+static struct miscdevice ctl_device = {
+       .name  = "dlm-control",
+       .fops  = &ctl_device_fops,
+       .minor = MISC_DYNAMIC_MINOR,
+};
+
 int dlm_user_init(void)
 {
        int error;
 
-       ctl_device.name = "dlm-control";
-       ctl_device.fops = &ctl_device_fops;
-       ctl_device.minor = MISC_DYNAMIC_MINOR;
-
        error = misc_register(&ctl_device);
        if (error)
                log_print("misc_register failed for control device");