Skip to content

Commit 0fe410d

Browse files
crquanteigland
authored andcommitted
dlm: static initialization improvements
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>
1 parent dbcfc34 commit 0fe410d

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

‎fs/dlm/user.c‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
#include "lvb_table.h"
2525
#include "user.h"
2626

27-
static const char *name_prefix="dlm";
28-
static struct miscdevice ctl_device;
27+
static const char name_prefix[] = "dlm";
2928
static const struct file_operations device_fops;
3029

3130
#ifdef CONFIG_COMPAT
@@ -902,14 +901,16 @@ static const struct file_operations ctl_device_fops = {
902901
.owner = THIS_MODULE,
903902
};
904903

904+
static struct miscdevice ctl_device = {
905+
.name = "dlm-control",
906+
.fops = &ctl_device_fops,
907+
.minor = MISC_DYNAMIC_MINOR,
908+
};
909+
905910
int dlm_user_init(void)
906911
{
907912
int error;
908913

909-
ctl_device.name = "dlm-control";
910-
ctl_device.fops = &ctl_device_fops;
911-
ctl_device.minor = MISC_DYNAMIC_MINOR;
912-
913914
error = misc_register(&ctl_device);
914915
if (error)
915916
log_print("misc_register failed for control device");

0 commit comments

Comments
 (0)