WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 03/11] xen: use static initializers in xen-balloon.c

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 03/11] xen: use static initializers in xen-balloon.c
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Thu, 28 Jul 2011 15:23:03 +0200
Delivery-date: Thu, 28 Jul 2011 06:24:12 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1311859385; l=1788; s=domk; d=aepfle.de; h=References:Subject:To:From:Date:X-RZG-CLASS-ID:X-RZG-AUTH; bh=qwQcMfJmTBJyNni8Kx0TyP3aJoM=; b=kP9ok28E3sKwQDNqgXZfVzryYD2FeB+VYA/gz02VA5GWfOGnX8x3O9liYhx2CuijnK8 3hk7eFtz9VpikuCGSbCuse2ncdYu3f6/fKep2peOo+A1yJ6mMOfrh698k9Ey7nCICZoiP Wfh27CAmMtyjgVA5aI6Ql4uiJAOSA5+qJKY=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20110728132300.248098023@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: quilt/0.48-16.4
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: Olaf Hering <olaf@xxxxxxxxx>

---
 drivers/xen/xen-balloon.c |   18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

Index: linux-3.0/drivers/xen/xen-balloon.c
===================================================================
--- linux-3.0.orig/drivers/xen/xen-balloon.c
+++ linux-3.0/drivers/xen/xen-balloon.c
@@ -50,11 +50,6 @@ static struct sys_device balloon_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 */
 static void watch_target(struct xenbus_watch *watch,
                         const char **vec, unsigned int len)
@@ -74,6 +69,11 @@ static void watch_target(struct xenbus_w
        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,
                                unsigned long event,
                                void *data)
@@ -87,7 +87,9 @@ static int balloon_init_watcher(struct n
        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)
 {
@@ -97,10 +99,6 @@ static int __init balloon_init(void)
        pr_info("xen-balloon: Initialising balloon driver.\n");
 
        register_balloon(&balloon_sysdev);
-
-       target_watch.callback = watch_target;
-       xenstore_notifier.notifier_call = balloon_init_watcher;
-
        register_xenstore_notifier(&xenstore_notifier);
 
        return 0;


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel