[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] Declare local variables at the start of a block, not in the middle
# 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", §ors, - "info", "%u", &binfo, - "sector-size", "%lu", §or_size, - NULL); + err = xenbus_gather(NULL, info->xbdev->otherend, + "sectors", "%lu", §ors, + "info", "%u", &binfo, + "sector-size", "%lu", §or_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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |