direct-io.hg

changeset 7787:3842ebd7d480

Declare local variables at the start of a block, not in the middle
(ISO C constraint).

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon Nov 14 11:47:38 2005 +0100 (2005-11-14)
parents 20bd6f55b813
children 2de6e301a640
files linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Mon Nov 14 11:36:42 2005 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Mon Nov 14 11:47:38 2005 +0100
     1.3 @@ -293,17 +293,18 @@ static void connect(struct blkfront_info
     1.4  {
     1.5  	unsigned long sectors, sector_size;
     1.6  	unsigned int binfo;
     1.7 +	int err;
     1.8  
     1.9          if (info->connected == BLKIF_STATE_CONNECTED)
    1.10  		return;
    1.11  
    1.12  	DPRINTK("blkfront.c:connect:%s.\n", info->xbdev->otherend);
    1.13  
    1.14 -	int err = xenbus_gather(NULL, info->xbdev->otherend,
    1.15 -				"sectors", "%lu", &sectors,
    1.16 -				"info", "%u", &binfo,
    1.17 -				"sector-size", "%lu", &sector_size,
    1.18 -				NULL);
    1.19 +	err = xenbus_gather(NULL, info->xbdev->otherend,
    1.20 +			    "sectors", "%lu", &sectors,
    1.21 +			    "info", "%u", &binfo,
    1.22 +			    "sector-size", "%lu", &sector_size,
    1.23 +			    NULL);
    1.24  	if (err) {
    1.25  		xenbus_dev_fatal(info->xbdev, err,
    1.26  				 "reading backend fields at %s",
    1.27 @@ -349,9 +350,9 @@ static void blkfront_closing(struct xenb
    1.28  
    1.29  static int blkfront_remove(struct xenbus_device *dev)
    1.30  {
    1.31 -	DPRINTK("blkfront_remove: %s removed\n", dev->nodename);
    1.32 +	struct blkfront_info *info = dev->data;
    1.33  
    1.34 -	struct blkfront_info *info = dev->data;
    1.35 +	DPRINTK("blkfront_remove: %s removed\n", dev->nodename);
    1.36  
    1.37  	blkif_free(info);
    1.38  
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c	Mon Nov 14 11:36:42 2005 +0100
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c	Mon Nov 14 11:47:38 2005 +0100
     2.3 @@ -118,10 +118,11 @@ static int netback_hotplug(struct xenbus
     2.4  	struct backend_info *be = xdev->data;
     2.5  	netif_t *netif = be->netif;
     2.6  	int i = 0, length = 0;
     2.7 +	char *val;
     2.8  
     2.9  	DPRINTK("netback_hotplug");
    2.10  
    2.11 -	char *val = xenbus_read(NULL, xdev->nodename, "script", NULL);
    2.12 +	val = xenbus_read(NULL, xdev->nodename, "script", NULL);
    2.13  	if (IS_ERR(val)) {
    2.14  		int err = PTR_ERR(val);
    2.15  		xenbus_dev_fatal(xdev, err, "reading script");
     3.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Mon Nov 14 11:36:42 2005 +0100
     3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Mon Nov 14 11:47:38 2005 +0100
     3.3 @@ -284,6 +284,7 @@ static void otherend_changed(struct xenb
     3.4  	struct xenbus_device *dev =
     3.5  		container_of(watch, struct xenbus_device, otherend_watch);
     3.6  	struct xenbus_driver *drv = to_xenbus_driver(dev->dev.driver);
     3.7 +	XenbusState state;
     3.8  
     3.9  	/* Protect us against watches firing on old details when the otherend
    3.10  	   details change, say immediately after a resume. */
    3.11 @@ -294,9 +295,10 @@ static void otherend_changed(struct xenb
    3.12  		return;
    3.13  	}
    3.14  
    3.15 -	XenbusState state = xenbus_read_driver_state(dev->otherend);
    3.16 +	state = xenbus_read_driver_state(dev->otherend);
    3.17  
    3.18 -	DPRINTK("state is %d, %s, %s", state, dev->otherend_watch.node, vec[XS_WATCH_PATH]);
    3.19 +	DPRINTK("state is %d, %s, %s",
    3.20 +		state, dev->otherend_watch.node, vec[XS_WATCH_PATH]);
    3.21  
    3.22  	drv->otherend_changed(dev, state);
    3.23  }