]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commitdiff
xenbus: replace list_for_each..._safe() by list_for_each...() where possible
authorJan Beulich <jbeulich@novell.com>
Thu, 23 Jun 2011 10:14:00 +0000 (11:14 +0100)
committerJan Beulich <jbeulich@novell.com>
Thu, 23 Jun 2011 10:14:00 +0000 (11:14 +0100)
There's no need for using the ..._safe() list iterators when deletion
of objects is followed by a loop exit.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
drivers/xen/netback/accel.c
drivers/xen/pciback/vpci.c
drivers/xen/xenbus/xenbus_dev.c

index 181c3632503a756736465e5d57918d0d8cea0e38..a9d0365c993aa30cc4a175af5cc5e0c8a65b5e64 100644 (file)
@@ -208,10 +208,10 @@ EXPORT_SYMBOL_GPL(netback_connect_accelerator);
  */
 void netback_disconnect_accelerator(int id, const char *eth_name)
 {
-       struct netback_accelerator *accelerator, *next;
+       struct netback_accelerator *accelerator;
 
        mutex_lock(&accelerators_mutex);
-       list_for_each_entry_safe(accelerator, next, &accelerators_list, link) {
+       list_for_each_entry(accelerator, &accelerators_list, link) {
                if (!strcmp(eth_name, accelerator->eth_name)) {
                        xenbus_for_each_backend
                                (accelerator, netback_accelerator_remove_backend);
index a5b7ecee87438e6a0bba4557528f509d13fc6c69..91a878fe323949fb2e2c7d9d62624f9c1f0f7bdd 100644 (file)
@@ -146,9 +146,9 @@ void pciback_release_pci_dev(struct pciback_device *pdev, struct pci_dev *dev)
        spin_lock_irqsave(&vpci_dev->lock, flags);
 
        for (slot = 0; slot < PCI_SLOT_MAX; slot++) {
-               struct pci_dev_entry *e, *tmp;
-               list_for_each_entry_safe(e, tmp, &vpci_dev->dev_list[slot],
-                                        list) {
+               struct pci_dev_entry *e;
+
+               list_for_each_entry(e, &vpci_dev->dev_list[slot], list) {
                        if (e->dev == dev) {
                                list_del(&e->list);
                                found_dev = e->dev;
index 7a73952a5f3faadccbdf85c9453f0a75e0d2494f..965bb87fe17f44f82b3ae08551d278aabb5ecd31 100644 (file)
@@ -233,7 +233,7 @@ static ssize_t xenbus_dev_write(struct file *filp,
        void *reply = NULL;
        LIST_HEAD(queue);
        char *path, *token;
-       struct watch_adapter *watch, *tmp_watch;
+       struct watch_adapter *watch;
        int err, rc = len;
 
        if (!is_xenstored_ready())
@@ -289,8 +289,7 @@ static ssize_t xenbus_dev_write(struct file *filp,
                        
                        list_add(&watch->list, &u->watches);
                } else {
-                       list_for_each_entry_safe(watch, tmp_watch,
-                                                 &u->watches, list) {
+                       list_for_each_entry(watch, &u->watches, list) {
                                if (!strcmp(watch->token, token) &&
                                    !strcmp(watch->watch.node, path))
                                {