xcp-1.6-updates/xen-4.1.hg

changeset 23230:bc8f88be9e4b

mini-os: stop compiler complaint about unused variables

gcc (GCC) 4.6.2 20111027 (Red Hat 4.6.2-1) complains about unused
variables
in mini-os drivers

Signed-off-by: John McDermott <john.mcdermott@nrl.navy.mil>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset: 24743:86f2630d62a9
xen-unstable date: Thu Feb 09 16:03:05 2012 +0000


minios: Remove unused variables warnings

s/DEBUG/printk/ in test_xenbus and all associated
do_*_test+xenbus_dbg_message
and always print the IRQ and MFN used by the xenbus on init.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Tested-by: John McDermott <john.mcdermott@nrl.navy.mil>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset: 24844:c78636d15ac5
xen-unstable date: Mon Feb 20 18:48:32 2012 +0000


Backported-by: Keir Fraser <keir@xen.org>
author John McDermott <john.mcdermott@nrl.navy.mil>
date Thu Feb 23 10:35:41 2012 +0000 (2012-02-23)
parents 8435c27b3499
children 04d72f81775d
files extras/mini-os/blkfront.c extras/mini-os/console/xencons_ring.c extras/mini-os/fbfront.c extras/mini-os/netfront.c extras/mini-os/pcifront.c extras/mini-os/xenbus/xenbus.c
line diff
     1.1 --- a/extras/mini-os/blkfront.c	Thu Feb 23 10:34:14 2012 +0000
     1.2 +++ b/extras/mini-os/blkfront.c	Thu Feb 23 10:35:41 2012 +0000
     1.3 @@ -171,6 +171,7 @@ again:
     1.4  abort_transaction:
     1.5      free(err);
     1.6      err = xenbus_transaction_end(xbt, 1, &retry);
     1.7 +    printk("Abort transaction %s\n", message);
     1.8      goto error;
     1.9  
    1.10  done:
     2.1 --- a/extras/mini-os/console/xencons_ring.c	Thu Feb 23 10:34:14 2012 +0000
     2.2 +++ b/extras/mini-os/console/xencons_ring.c	Thu Feb 23 10:35:41 2012 +0000
     2.3 @@ -317,6 +317,7 @@ again:
     2.4  abort_transaction:
     2.5      free(err);
     2.6      err = xenbus_transaction_end(xbt, 1, &retry);
     2.7 +    printk("Abort transaction %s\n", message);
     2.8      goto error;
     2.9  
    2.10  done:
     3.1 --- a/extras/mini-os/fbfront.c	Thu Feb 23 10:34:14 2012 +0000
     3.2 +++ b/extras/mini-os/fbfront.c	Thu Feb 23 10:35:41 2012 +0000
     3.3 @@ -142,6 +142,7 @@ again:
     3.4  abort_transaction:
     3.5      free(err);
     3.6      err = xenbus_transaction_end(xbt, 1, &retry);
     3.7 +    printk("Abort transaction %s\n", message);
     3.8      goto error;
     3.9  
    3.10  done:
    3.11 @@ -503,6 +504,7 @@ again:
    3.12  abort_transaction:
    3.13      free(err);
    3.14      err = xenbus_transaction_end(xbt, 1, &retry);
    3.15 +    printk("Abort transaction %s\n", message);
    3.16      goto error;
    3.17  
    3.18  done:
     4.1 --- a/extras/mini-os/netfront.c	Thu Feb 23 10:34:14 2012 +0000
     4.2 +++ b/extras/mini-os/netfront.c	Thu Feb 23 10:35:41 2012 +0000
     4.3 @@ -421,6 +421,7 @@ again:
     4.4  abort_transaction:
     4.5      free(err);
     4.6      err = xenbus_transaction_end(xbt, 1, &retry);
     4.7 +    printk("Abort transaction %s\n", message);
     4.8      goto error;
     4.9  
    4.10  done:
     5.1 --- a/extras/mini-os/pcifront.c	Thu Feb 23 10:34:14 2012 +0000
     5.2 +++ b/extras/mini-os/pcifront.c	Thu Feb 23 10:35:41 2012 +0000
     5.3 @@ -222,6 +222,7 @@ again:
     5.4  abort_transaction:
     5.5      free(err);
     5.6      err = xenbus_transaction_end(xbt, 1, &retry);
     5.7 +    printk("Abort transaction %s\n", message);
     5.8      goto error;
     5.9  
    5.10  done:
     6.1 --- a/extras/mini-os/xenbus/xenbus.c	Thu Feb 23 10:34:14 2012 +0000
     6.2 +++ b/extras/mini-os/xenbus/xenbus.c	Thu Feb 23 10:35:41 2012 +0000
     6.3 @@ -328,7 +328,6 @@ static int allocate_xenbus_id(void)
     6.4  void init_xenbus(void)
     6.5  {
     6.6      int err;
     6.7 -    printk("Initialising xenbus\n");
     6.8      DEBUG("init_xenbus called.\n");
     6.9      xenstore_buf = mfn_to_virt(start_info.store_mfn);
    6.10      create_thread("xenstore", xenbus_thread_func, NULL);
    6.11 @@ -337,7 +336,8 @@ void init_xenbus(void)
    6.12  		      xenbus_evtchn_handler,
    6.13                NULL);
    6.14      unmask_evtchn(start_info.store_evtchn);
    6.15 -    DEBUG("xenbus on irq %d\n", err);
    6.16 +    printk("xenbus initialised on irq %d mfn %#lx\n",
    6.17 +	   err, start_info.store_mfn);
    6.18  }
    6.19  
    6.20  void fini_xenbus(void)
    6.21 @@ -478,7 +478,7 @@ static void xenbus_debug_msg(const char 
    6.22      struct xsd_sockmsg *reply;
    6.23  
    6.24      reply = xenbus_msg_reply(XS_DEBUG, 0, req, ARRAY_SIZE(req));
    6.25 -    DEBUG("Got a reply, type %d, id %d, len %d.\n",
    6.26 +    printk("Got a reply, type %d, id %d, len %d.\n",
    6.27              reply->type, reply->req_id, reply->len);
    6.28  }
    6.29  
    6.30 @@ -752,16 +752,16 @@ static void do_ls_test(const char *pre)
    6.31      char **dirs, *msg;
    6.32      int x;
    6.33  
    6.34 -    DEBUG("ls %s...\n", pre);
    6.35 +    printk("ls %s...\n", pre);
    6.36      msg = xenbus_ls(XBT_NIL, pre, &dirs);
    6.37      if (msg) {
    6.38 -	DEBUG("Error in xenbus ls: %s\n", msg);
    6.39 +	printk("Error in xenbus ls: %s\n", msg);
    6.40  	free(msg);
    6.41  	return;
    6.42      }
    6.43      for (x = 0; dirs[x]; x++) 
    6.44      {
    6.45 -        DEBUG("ls %s[%d] -> %s\n", pre, x, dirs[x]);
    6.46 +        printk("ls %s[%d] -> %s\n", pre, x, dirs[x]);
    6.47          free(dirs[x]);
    6.48      }
    6.49      free(dirs);
    6.50 @@ -770,68 +770,68 @@ static void do_ls_test(const char *pre)
    6.51  static void do_read_test(const char *path)
    6.52  {
    6.53      char *res, *msg;
    6.54 -    DEBUG("Read %s...\n", path);
    6.55 +    printk("Read %s...\n", path);
    6.56      msg = xenbus_read(XBT_NIL, path, &res);
    6.57      if (msg) {
    6.58 -	DEBUG("Error in xenbus read: %s\n", msg);
    6.59 +	printk("Error in xenbus read: %s\n", msg);
    6.60  	free(msg);
    6.61  	return;
    6.62      }
    6.63 -    DEBUG("Read %s -> %s.\n", path, res);
    6.64 +    printk("Read %s -> %s.\n", path, res);
    6.65      free(res);
    6.66  }
    6.67  
    6.68  static void do_write_test(const char *path, const char *val)
    6.69  {
    6.70      char *msg;
    6.71 -    DEBUG("Write %s to %s...\n", val, path);
    6.72 +    printk("Write %s to %s...\n", val, path);
    6.73      msg = xenbus_write(XBT_NIL, path, val);
    6.74      if (msg) {
    6.75 -	DEBUG("Result %s\n", msg);
    6.76 +	printk("Result %s\n", msg);
    6.77  	free(msg);
    6.78      } else {
    6.79 -	DEBUG("Success.\n");
    6.80 +	printk("Success.\n");
    6.81      }
    6.82  }
    6.83  
    6.84  static void do_rm_test(const char *path)
    6.85  {
    6.86      char *msg;
    6.87 -    DEBUG("rm %s...\n", path);
    6.88 +    printk("rm %s...\n", path);
    6.89      msg = xenbus_rm(XBT_NIL, path);
    6.90      if (msg) {
    6.91 -	DEBUG("Result %s\n", msg);
    6.92 +	printk("Result %s\n", msg);
    6.93  	free(msg);
    6.94      } else {
    6.95 -	DEBUG("Success.\n");
    6.96 +	printk("Success.\n");
    6.97      }
    6.98  }
    6.99  
   6.100  /* Simple testing thing */
   6.101  void test_xenbus(void)
   6.102  {
   6.103 -    DEBUG("Doing xenbus test.\n");
   6.104 +    printk("Doing xenbus test.\n");
   6.105      xenbus_debug_msg("Testing xenbus...\n");
   6.106  
   6.107 -    DEBUG("Doing ls test.\n");
   6.108 +    printk("Doing ls test.\n");
   6.109      do_ls_test("device");
   6.110      do_ls_test("device/vif");
   6.111      do_ls_test("device/vif/0");
   6.112  
   6.113 -    DEBUG("Doing read test.\n");
   6.114 +    printk("Doing read test.\n");
   6.115      do_read_test("device/vif/0/mac");
   6.116      do_read_test("device/vif/0/backend");
   6.117  
   6.118 -    DEBUG("Doing write test.\n");
   6.119 +    printk("Doing write test.\n");
   6.120      do_write_test("device/vif/0/flibble", "flobble");
   6.121      do_read_test("device/vif/0/flibble");
   6.122      do_write_test("device/vif/0/flibble", "widget");
   6.123      do_read_test("device/vif/0/flibble");
   6.124  
   6.125 -    DEBUG("Doing rm test.\n");
   6.126 +    printk("Doing rm test.\n");
   6.127      do_rm_test("device/vif/0/flibble");
   6.128      do_read_test("device/vif/0/flibble");
   6.129 -    DEBUG("(Should have said ENOENT)\n");
   6.130 +    printk("(Should have said ENOENT)\n");
   6.131  }
   6.132  
   6.133  /*