summaryrefslogtreecommitdiffstats
path: root/drivers/media/v4l2-core
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2023-07-29 13:52:14 +0200
committerMauro Carvalho Chehab <mchehab@kernel.org>2023-08-10 07:58:39 +0200
commitceee7fb05bad66d3ae295664beb348673681e498 (patch)
tree19bd9e9c8c50f7652b8571aff738da522ecfc420 /drivers/media/v4l2-core
parent82bc596df84daa5ff6b3e706a8473801de49e2ee (diff)
downloadlinux-ceee7fb05bad66d3ae295664beb348673681e498.tar.gz
linux-ceee7fb05bad66d3ae295664beb348673681e498.tar.bz2
linux-ceee7fb05bad66d3ae295664beb348673681e498.zip
media: v4l: async: Avoid a goto in loop implementation
Replace a goto-based loop by a while loop. Suggested-by: Mauro Carvalho Chehab <mchehab@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/v4l2-core')
-rw-r--r--drivers/media/v4l2-core/v4l2-async.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c
index f465a0964adf..091e8cf4114b 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 */