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-changelog

[Xen-changelog] Declare local variables at the start of a block, not in

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Declare local variables at the start of a block, not in the middle
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 14 Nov 2005 18:58:14 +0000
Delivery-date: Mon, 14 Nov 2005 18:59:25 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 3842ebd7d480ed1dec103b51edba6c2890c3c1da
# Parent  20bd6f55b813aa145fff73891fcdd9a1c4db9b8c
Declare local variables at the start of a block, not in the middle
(ISO C constraint).

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 20bd6f55b813 -r 3842ebd7d480 
linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c      Mon Nov 14 
10:36:42 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c      Mon Nov 14 
10:47:38 2005
@@ -293,17 +293,18 @@
 {
        unsigned long sectors, sector_size;
        unsigned int binfo;
+       int err;
 
         if (info->connected == BLKIF_STATE_CONNECTED)
                return;
 
        DPRINTK("blkfront.c:connect:%s.\n", info->xbdev->otherend);
 
-       int err = xenbus_gather(NULL, info->xbdev->otherend,
-                               "sectors", "%lu", &sectors,
-                               "info", "%u", &binfo,
-                               "sector-size", "%lu", &sector_size,
-                               NULL);
+       err = xenbus_gather(NULL, info->xbdev->otherend,
+                           "sectors", "%lu", &sectors,
+                           "info", "%u", &binfo,
+                           "sector-size", "%lu", &sector_size,
+                           NULL);
        if (err) {
                xenbus_dev_fatal(info->xbdev, err,
                                 "reading backend fields at %s",
@@ -349,9 +350,9 @@
 
 static int blkfront_remove(struct xenbus_device *dev)
 {
+       struct blkfront_info *info = dev->data;
+
        DPRINTK("blkfront_remove: %s removed\n", dev->nodename);
-
-       struct blkfront_info *info = dev->data;
 
        blkif_free(info);
 
diff -r 20bd6f55b813 -r 3842ebd7d480 
linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c
--- a/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c Mon Nov 14 10:36:42 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c Mon Nov 14 10:47:38 2005
@@ -118,10 +118,11 @@
        struct backend_info *be = xdev->data;
        netif_t *netif = be->netif;
        int i = 0, length = 0;
+       char *val;
 
        DPRINTK("netback_hotplug");
 
-       char *val = xenbus_read(NULL, xdev->nodename, "script", NULL);
+       val = xenbus_read(NULL, xdev->nodename, "script", NULL);
        if (IS_ERR(val)) {
                int err = PTR_ERR(val);
                xenbus_dev_fatal(xdev, err, "reading script");
diff -r 20bd6f55b813 -r 3842ebd7d480 
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c    Mon Nov 14 
10:36:42 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c    Mon Nov 14 
10:47:38 2005
@@ -284,6 +284,7 @@
        struct xenbus_device *dev =
                container_of(watch, struct xenbus_device, otherend_watch);
        struct xenbus_driver *drv = to_xenbus_driver(dev->dev.driver);
+       XenbusState state;
 
        /* Protect us against watches firing on old details when the otherend
           details change, say immediately after a resume. */
@@ -294,9 +295,10 @@
                return;
        }
 
-       XenbusState state = xenbus_read_driver_state(dev->otherend);
-
-       DPRINTK("state is %d, %s, %s", state, dev->otherend_watch.node, 
vec[XS_WATCH_PATH]);
+       state = xenbus_read_driver_state(dev->otherend);
+
+       DPRINTK("state is %d, %s, %s",
+               state, dev->otherend_watch.node, vec[XS_WATCH_PATH]);
 
        drv->otherend_changed(dev, state);
 }

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Declare local variables at the start of a block, not in the middle, Xen patchbot -unstable <=