From: Christian Gromm Date: Mon, 6 Jun 2016 13:23:06 +0000 (+0200) Subject: staging: most: v4l2-aim: optimize list_for_each_entry_safe X-Git-Tag: Ubuntu-5.4-5.4.0-11.14~9287^2~1181 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=db5a48d595cfd27ba66625558d982205b46d11fd;p=mirror_ubuntu-focal-kernel.git 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 --- 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;