Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db5a48d5 authored by Christian Gromm's avatar Christian Gromm Committed by Greg Kroah-Hartman
Browse files

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: default avatarAndrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: default avatarChristian Gromm <christian.gromm@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e494df03
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;