提交 0fe410d3 编写于 作者: D Denis Cheng 提交者: David Teigland

dlm: static initialization improvements

also change name_prefix from char pointer to char array.
Signed-off-by: NDenis Cheng <crquan@gmail.com>
Signed-off-by: NDavid Teigland <teigland@redhat.com>
上级 dbcfc347
...@@ -24,8 +24,7 @@ ...@@ -24,8 +24,7 @@
#include "lvb_table.h" #include "lvb_table.h"
#include "user.h" #include "user.h"
static const char *name_prefix="dlm"; static const char name_prefix[] = "dlm";
static struct miscdevice ctl_device;
static const struct file_operations device_fops; static const struct file_operations device_fops;
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
...@@ -902,14 +901,16 @@ static const struct file_operations ctl_device_fops = { ...@@ -902,14 +901,16 @@ static const struct file_operations ctl_device_fops = {
.owner = THIS_MODULE, .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 dlm_user_init(void)
{ {
int error; int error;
ctl_device.name = "dlm-control";
ctl_device.fops = &ctl_device_fops;
ctl_device.minor = MISC_DYNAMIC_MINOR;
error = misc_register(&ctl_device); error = misc_register(&ctl_device);
if (error) if (error)
log_print("misc_register failed for control device"); log_print("misc_register failed for control device");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册