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] [linux-2.6.18-xen] xenbus: replace list_for_each..._safe

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] xenbus: replace list_for_each..._safe() by list_for_each...() where possible
From: Xen patchbot-linux-2.6.18-xen <patchbot@xxxxxxx>
Date: Thu, 23 Jun 2011 11:22:03 +0100
Delivery-date: Thu, 23 Jun 2011 03:22:39 -0700
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 Jan Beulich <jbeulich@xxxxxxxxxx>
# Date 1308824040 -3600
# Node ID 3c900d6a5f6a51ff1547f21fef30ab8b92feccc9
# Parent  53ca64bc2072c0ca300439ba0bd99f33b843f0e7
xenbus: replace list_for_each..._safe() by list_for_each...() where possible

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@xxxxxxxxxx>
---


diff -r 53ca64bc2072 -r 3c900d6a5f6a drivers/xen/netback/accel.c
--- a/drivers/xen/netback/accel.c       Thu Jun 23 11:13:16 2011 +0100
+++ b/drivers/xen/netback/accel.c       Thu Jun 23 11:14:00 2011 +0100
@@ -208,10 +208,10 @@
  */
 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);
diff -r 53ca64bc2072 -r 3c900d6a5f6a drivers/xen/pciback/vpci.c
--- a/drivers/xen/pciback/vpci.c        Thu Jun 23 11:13:16 2011 +0100
+++ b/drivers/xen/pciback/vpci.c        Thu Jun 23 11:14:00 2011 +0100
@@ -146,9 +146,9 @@
        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;
diff -r 53ca64bc2072 -r 3c900d6a5f6a drivers/xen/xenbus/xenbus_dev.c
--- a/drivers/xen/xenbus/xenbus_dev.c   Thu Jun 23 11:13:16 2011 +0100
+++ b/drivers/xen/xenbus/xenbus_dev.c   Thu Jun 23 11:14:00 2011 +0100
@@ -233,7 +233,7 @@
        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 @@
                        
                        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))
                                {

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] xenbus: replace list_for_each..._safe() by list_for_each...() where possible, Xen patchbot-linux-2 . 6 . 18-xen <=