diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2007-10-10 05:37:42 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-10-10 13:35:07 -0300 |
commit | 6d28e98906aa9405895f92348543d08da1837ea5 (patch) | |
tree | 3f92cb9777405d0576f36b86501820c191deab3d /drivers/media/video/saa7134/saa7134-empress.c | |
parent | 805a43924158e4eb2bffc4cac0aedcfb42a89469 (diff) | |
download | op-kernel-dev-6d28e98906aa9405895f92348543d08da1837ea5.zip op-kernel-dev-6d28e98906aa9405895f92348543d08da1837ea5.tar.gz |
V4L/DVB (6314): saa7134: Replace list_for_each+list_entry with list_for_each_entry
A couple loops weren't changed because they expected the loop iterator
to be left as NULL if the list was empty. Maybe the code should just
check for that first, then loop?
Adjust some of the loop logic to be simpler.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-empress.c')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-empress.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c index a16df57..34ca874d 100644 --- a/drivers/media/video/saa7134/saa7134-empress.c +++ b/drivers/media/video/saa7134/saa7134-empress.c @@ -76,17 +76,14 @@ static int ts_init_encoder(struct saa7134_dev* dev) static int ts_open(struct inode *inode, struct file *file) { int minor = iminor(inode); - struct saa7134_dev *h,*dev = NULL; - struct list_head *list; + struct saa7134_dev *dev; int err; - list_for_each(list,&saa7134_devlist) { - h = list_entry(list, struct saa7134_dev, devlist); - if (h->empress_dev && h->empress_dev->minor == minor) - dev = h; - } - if (NULL == dev) - return -ENODEV; + list_for_each_entry(dev, &saa7134_devlist, devlist) + if (dev->empress_dev && dev->empress_dev->minor == minor) + goto found; + return -ENODEV; + found: dprintk("open minor=%d\n",minor); err = -EBUSY; |