diff options
author | Deepak R Varma <mh12gx2825@gmail.com> | 2020-03-31 01:20:57 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-04-14 12:31:37 +0200 |
commit | f744d9a4fee3a80f341eb04dad92256b513790ab (patch) | |
tree | bbec4f0c8424076d6961689fb6d583b547b7e2f7 /drivers/staging/media/ipu3 | |
parent | ce7d96a4a77d3db1ae86415c0a74bf812dc81103 (diff) | |
download | linux-stable-f744d9a4fee3a80f341eb04dad92256b513790ab.tar.gz linux-stable-f744d9a4fee3a80f341eb04dad92256b513790ab.tar.bz2 linux-stable-f744d9a4fee3a80f341eb04dad92256b513790ab.zip |
media: staging/intel-ipu3: Simplify single goto jump
On successful node setup, the code jumps to a cleanup label to perform
nodes cleanup. This only call to cleanup using goto label can be
included in the for / if blocks to make it look more associated.
Signed-off-by: Deepak R Varma <mh12gx2825@gmail.com>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging/media/ipu3')
-rw-r--r-- | drivers/staging/media/ipu3/ipu3-v4l2.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/staging/media/ipu3/ipu3-v4l2.c b/drivers/staging/media/ipu3/ipu3-v4l2.c index 9c121ab461ab..afbb4636e714 100644 --- a/drivers/staging/media/ipu3/ipu3-v4l2.c +++ b/drivers/staging/media/ipu3/ipu3-v4l2.c @@ -1300,19 +1300,17 @@ static void imgu_v4l2_nodes_cleanup_pipe(struct imgu_device *imgu, static int imgu_v4l2_nodes_setup_pipe(struct imgu_device *imgu, int pipe) { - int i, r; + int i; for (i = 0; i < IMGU_NODE_NUM; i++) { - r = imgu_v4l2_node_setup(imgu, pipe, i); - if (r) - goto cleanup; - } + int r = imgu_v4l2_node_setup(imgu, pipe, i); + if (r) { + imgu_v4l2_nodes_cleanup_pipe(imgu, pipe, i); + return r; + } + } return 0; - -cleanup: - imgu_v4l2_nodes_cleanup_pipe(imgu, pipe, i); - return r; } static void imgu_v4l2_subdev_cleanup(struct imgu_device *imgu, unsigned int i) |