staging: most: v4l2-aim: optimize list_for_each_entry_safe
authorChristian Gromm <christian.gromm@microchip.com>
Mon, 6 Jun 2016 13:23:06 +0000 (15:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Aug 2016 17:17:03 +0000 (19:17 +0200)
As the function get_aim_dev() does not delete elements of the list, the
use of macro list_for_each_entry_safe is not necessary.

This patch replaces the macro list_for_each_entry_safe with the macro
list_for_each_entry.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/aim-v4l2/video.c

index 1fea839e3c58759c2974da9d09554fe0a1a499b5..6b7e220a4c1b88047f52e59addc1ab8040fc297f 100644 (file)
@@ -393,11 +393,11 @@ static const struct video_device aim_videodev_template = {
 static struct most_video_dev *get_aim_dev(
        struct most_interface *iface, int channel_idx)
 {
-       struct most_video_dev *mdev, *tmp;
+       struct most_video_dev *mdev;
        unsigned long flags;
 
        spin_lock_irqsave(&list_lock, flags);
-       list_for_each_entry_safe(mdev, tmp, &video_devices, list) {
+       list_for_each_entry(mdev, &video_devices, list) {
                if (mdev->iface == iface && mdev->ch_idx == channel_idx) {
                        spin_unlock_irqrestore(&list_lock, flags);
                        return mdev;