Commit 6b71c52e authored by Olaf Hering's avatar Olaf Hering Committed by Konrad Rzeszutek Wilk

xen: use static initializers in xen-balloon.c

There is no need to use dynamic initializaion, it just confuses the reader.
Switch to static initializers like its used in other files.
Signed-off-by: default avatarOlaf Hering <olaf@aepfle.de>
[v2: Rebased on v3.0]
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent 6913200a
...@@ -50,11 +50,6 @@ static struct sys_device balloon_sysdev; ...@@ -50,11 +50,6 @@ static struct sys_device balloon_sysdev;
static int register_balloon(struct sys_device *sysdev); static int register_balloon(struct sys_device *sysdev);
static struct xenbus_watch target_watch =
{
.node = "memory/target"
};
/* React to a change in the target key */ /* React to a change in the target key */
static void watch_target(struct xenbus_watch *watch, static void watch_target(struct xenbus_watch *watch,
const char **vec, unsigned int len) const char **vec, unsigned int len)
...@@ -73,6 +68,11 @@ static void watch_target(struct xenbus_watch *watch, ...@@ -73,6 +68,11 @@ static void watch_target(struct xenbus_watch *watch,
*/ */
balloon_set_new_target(new_target >> (PAGE_SHIFT - 10)); balloon_set_new_target(new_target >> (PAGE_SHIFT - 10));
} }
static struct xenbus_watch target_watch = {
.node = "memory/target",
.callback = watch_target,
};
static int balloon_init_watcher(struct notifier_block *notifier, static int balloon_init_watcher(struct notifier_block *notifier,
unsigned long event, unsigned long event,
...@@ -87,7 +87,9 @@ static int balloon_init_watcher(struct notifier_block *notifier, ...@@ -87,7 +87,9 @@ static int balloon_init_watcher(struct notifier_block *notifier,
return NOTIFY_DONE; return NOTIFY_DONE;
} }
static struct notifier_block xenstore_notifier; static struct notifier_block xenstore_notifier = {
.notifier_call = balloon_init_watcher,
};
static int __init balloon_init(void) static int __init balloon_init(void)
{ {
...@@ -100,9 +102,6 @@ static int __init balloon_init(void) ...@@ -100,9 +102,6 @@ static int __init balloon_init(void)
register_xen_selfballooning(&balloon_sysdev); register_xen_selfballooning(&balloon_sysdev);
target_watch.callback = watch_target;
xenstore_notifier.notifier_call = balloon_init_watcher;
register_xenstore_notifier(&xenstore_notifier); register_xenstore_notifier(&xenstore_notifier);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment