aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-10-10 04:37:39 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-10 12:34:33 -0400
commit7948261942ffdb35e274b8e1a0889601f45d4603 (patch)
tree92255677bdcaf97d57a84b2fb103c41ef9ac8367 /drivers/media
parentc3e2a8e64cb2282a406ff6e63f7bd09eb6f61a1d (diff)
V4L/DVB (6311): dvb: Replace list_for_each+list_entry with list_for_each_entry
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/dvb-core/dvb_demux.c5
-rw-r--r--drivers/media/dvb/dvb-core/dvbdev.c27
2 files changed, 9 insertions, 23 deletions
diff --git a/drivers/media/dvb/dvb-core/dvb_demux.c b/drivers/media/dvb/dvb-core/dvb_demux.c
index cb6987fce26c..7959020f9317 100644
--- a/drivers/media/dvb/dvb-core/dvb_demux.c
+++ b/drivers/media/dvb/dvb-core/dvb_demux.c
@@ -373,13 +373,10 @@ static inline void dvb_dmx_swfilter_packet_type(struct dvb_demux_feed *feed,
373static void dvb_dmx_swfilter_packet(struct dvb_demux *demux, const u8 *buf) 373static void dvb_dmx_swfilter_packet(struct dvb_demux *demux, const u8 *buf)
374{ 374{
375 struct dvb_demux_feed *feed; 375 struct dvb_demux_feed *feed;
376 struct list_head *pos, *head = &demux->feed_list;
377 u16 pid = ts_pid(buf); 376 u16 pid = ts_pid(buf);
378 int dvr_done = 0; 377 int dvr_done = 0;
379 378
380 list_for_each(pos, head) { 379 list_for_each_entry(feed, &demux->feed_list, list_head) {
381 feed = list_entry(pos, struct dvb_demux_feed, list_head);
382
383 if ((feed->pid != pid) && (feed->pid != 0x2000)) 380 if ((feed->pid != pid) && (feed->pid != 0x2000))
384 continue; 381 continue;
385 382
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c
index 6b7954daeb4a..56231d8edc07 100644
--- a/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/drivers/media/dvb/dvb-core/dvbdev.c
@@ -58,18 +58,13 @@ static struct class *dvb_class;
58 58
59static struct dvb_device* dvbdev_find_device (int minor) 59static struct dvb_device* dvbdev_find_device (int minor)
60{ 60{
61 struct list_head *entry; 61 struct dvb_adapter *adap;
62 62
63 list_for_each (entry, &dvb_adapter_list) { 63 list_for_each_entry(adap, &dvb_adapter_list, list_head) {
64 struct list_head *entry0; 64 struct dvb_device *dev;
65 struct dvb_adapter *adap; 65 list_for_each_entry(dev, &adap->device_list, list_head)
66 adap = list_entry (entry, struct dvb_adapter, list_head);
67 list_for_each (entry0, &adap->device_list) {
68 struct dvb_device *dev;
69 dev = list_entry (entry0, struct dvb_device, list_head);
70 if (nums2minor(adap->num, dev->type, dev->id) == minor) 66 if (nums2minor(adap->num, dev->type, dev->id) == minor)
71 return dev; 67 return dev;
72 }
73 } 68 }
74 69
75 return NULL; 70 return NULL;
@@ -179,13 +174,10 @@ static int dvbdev_get_free_id (struct dvb_adapter *adap, int type)
179 u32 id = 0; 174 u32 id = 0;
180 175
181 while (id < DVB_MAX_IDS) { 176 while (id < DVB_MAX_IDS) {
182 struct list_head *entry; 177 struct dvb_device *dev;
183 list_for_each (entry, &adap->device_list) { 178 list_for_each_entry(dev, &adap->device_list, list_head)
184 struct dvb_device *dev;
185 dev = list_entry (entry, struct dvb_device, list_head);
186 if (dev->type == type && dev->id == id) 179 if (dev->type == type && dev->id == id)
187 goto skip; 180 goto skip;
188 }
189 return id; 181 return id;
190skip: 182skip:
191 id++; 183 id++;
@@ -279,13 +271,10 @@ static int dvbdev_get_free_adapter_num (void)
279 int num = 0; 271 int num = 0;
280 272
281 while (num < DVB_MAX_ADAPTERS) { 273 while (num < DVB_MAX_ADAPTERS) {
282 struct list_head *entry; 274 struct dvb_adapter *adap;
283 list_for_each (entry, &dvb_adapter_list) { 275 list_for_each_entry(adap, &dvb_adapter_list, list_head)
284 struct dvb_adapter *adap;
285 adap = list_entry (entry, struct dvb_adapter, list_head);
286 if (adap->num == num) 276 if (adap->num == num)
287 goto skip; 277 goto skip;
288 }
289 return num; 278 return num;
290skip: 279skip:
291 num++; 280 num++;