patch-2.4.11-dontuse linux/drivers/ieee1394/highlevel.c

Next file: linux/drivers/ieee1394/hosts.c
Previous file: linux/drivers/ieee1394/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.10/linux/drivers/ieee1394/highlevel.c linux/drivers/ieee1394/highlevel.c
@@ -154,21 +154,18 @@
 }
 
 
-#define DEFINE_MULTIPLEXER(Function) \
-void highlevel_##Function(struct hpsb_host *host) \
-{ \
-        struct list_head *entry,*next; \
-        void (*funcptr)(struct hpsb_host*); \
-        read_lock(&hl_drivers_lock); \
-        entry = hl_drivers.next; \
-        while (entry != &hl_drivers) { \
-        	next = entry->next; \
-                funcptr = list_entry(entry, struct hpsb_highlevel, hl_list) \
-                          ->op->Function; \
-                if (funcptr) funcptr(host); \
-                entry = next; \
-        } \
-        read_unlock(&hl_drivers_lock); \
+#define DEFINE_MULTIPLEXER(Function)			\
+void highlevel_##Function(struct hpsb_host *host)	\
+{							\
+	struct list_head *lh;				\
+	void (*funcptr)(struct hpsb_host*);		\
+	read_lock(&hl_drivers_lock);			\
+	list_for_each(lh, &hl_drivers) {		\
+		funcptr = list_entry(lh, struct hpsb_highlevel, hl_list) \
+				->op->Function;		\
+		if (funcptr) funcptr(host);		\
+	}						\
+	read_unlock(&hl_drivers_lock);			\
 }
 
 DEFINE_MULTIPLEXER(add_host)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)