From ceee7fb05bad66d3ae295664beb348673681e498 Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Sat, 29 Jul 2023 13:52:14 +0200 Subject: [PATCH] media: v4l: async: Avoid a goto in loop implementation Replace a goto-based loop by a while loop. Suggested-by: Mauro Carvalho Chehab Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab --- drivers/media/v4l2-core/v4l2-async.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c index f465a09..091e8cf 100644 --- a/drivers/media/v4l2-core/v4l2-async.c +++ b/drivers/media/v4l2-core/v4l2-async.c @@ -820,20 +820,16 @@ int v4l2_async_register_subdev(struct v4l2_subdev *sd) if (!v4l2_dev) continue; -again: - asc = v4l2_async_find_match(notifier, sd); - if (!asc) - continue; - - ret = v4l2_async_match_notify(notifier, v4l2_dev, sd, asc); - if (ret) - goto err_unbind; - - ret = v4l2_async_nf_try_complete(notifier); - if (ret) - goto err_unbind; - - goto again; + while ((asc = v4l2_async_find_match(notifier, sd))) { + ret = v4l2_async_match_notify(notifier, v4l2_dev, sd, + asc); + if (ret) + goto err_unbind; + + ret = v4l2_async_nf_try_complete(notifier); + if (ret) + goto err_unbind; + } } /* None matched, wait for hot-plugging */ -- 2.7.4