summary refs log tree commit diff
path: root/drivers/media/video/v4l2-int-device.c
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-10-10 05:37:43 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-10 13:35:29 -0300
commita991f44b79fa49b281eb078eed4a76a42101012a (patch)
tree5a6b7a4ce700ef8bcdf59f816c0c04b5e64d215b /drivers/media/video/v4l2-int-device.c
parente77e2c2f2989eefff7e1c0fff9cb72afaedf6796 (diff)
downloadlinux-a991f44b79fa49b281eb078eed4a76a42101012a.tar.gz
V4L/DVB (6316): Change list_for_each+list_entry to list_for_each_entry
The rest of V4L files.

There is one list_for_each+list_entry in cpia_pp.c that
wasn't changed because it expects the loop iterator to remain NULL if
the list is empty.

A bug in vivi is fixed; the 'safe' version needs to be used because the loop
deletes the list entries.

Simplify a second loop in vivi and get rid if an un-used variable in that loop.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/v4l2-int-device.c')
-rw-r--r--drivers/media/video/v4l2-int-device.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/media/video/v4l2-int-device.c b/drivers/media/video/v4l2-int-device.c
index f497c9458344..8b4ef530a3a8 100644
--- a/drivers/media/video/v4l2-int-device.c
+++ b/drivers/media/video/v4l2-int-device.c
@@ -34,21 +34,13 @@ static LIST_HEAD(int_list);
 
 static void v4l2_int_device_try_attach_all(void)
 {
-	struct list_head *head_master;
-
-	list_for_each(head_master, &int_list) {
-		struct list_head *head_slave;
-		struct v4l2_int_device *m =
-			list_entry(head_master, struct v4l2_int_device, head);
+	struct v4l2_int_device *m, *s;
 
+	list_for_each_entry(m, &int_list, head) {
 		if (m->type != v4l2_int_type_master)
 			continue;
 
-		list_for_each(head_slave, &int_list) {
-			struct v4l2_int_device *s =
-				list_entry(head_slave,
-					   struct v4l2_int_device, head);
-
+		list_for_each_entry(s, &int_list, head) {
 			if (s->type != v4l2_int_type_slave)
 				continue;