From db5a48d595cfd27ba66625558d982205b46d11fd Mon Sep 17 00:00:00 2001 From: Christian Gromm Date: Mon, 6 Jun 2016 15:23:06 +0200 Subject: [PATCH] staging: most: v4l2-aim: optimize list_for_each_entry_safe 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 Signed-off-by: Christian Gromm Signed-off-by: Greg Kroah-Hartman --- drivers/staging/most/aim-v4l2/video.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/most/aim-v4l2/video.c b/drivers/staging/most/aim-v4l2/video.c index 1fea839e3c58..6b7e220a4c1b 100644 --- a/drivers/staging/most/aim-v4l2/video.c +++ b/drivers/staging/most/aim-v4l2/video.c @@ -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; -- 2.39.5