* [PATCH] media: staging/intel-ipu3: Simplify single goto jump
@ 2020-03-22 21:42 Deepak R Varma
2020-03-23 0:50 ` [Outreachy kernel] " Stefano Brivio
0 siblings, 1 reply; 3+ messages in thread
From: Deepak R Varma @ 2020-03-22 21:42 UTC (permalink / raw)
To: outreachy-kernel, gregkh, daniel.baluta, kieran.bingham
Cc: Sakari Ailus, Mauro Carvalho Chehab, Greg Kroah-Hartman
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>
---
drivers/staging/media/ipu3/ipu3-v4l2.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/media/ipu3/ipu3-v4l2.c b/drivers/staging/media/ipu3/ipu3-v4l2.c
index e8f33539a217..bd8cb7571038 100644
--- a/drivers/staging/media/ipu3/ipu3-v4l2.c
+++ b/drivers/staging/media/ipu3/ipu3-v4l2.c
@@ -1295,15 +1295,13 @@ static int imgu_v4l2_nodes_setup_pipe(struct imgu_device *imgu, int pipe)
for (i = 0; i < IMGU_NODE_NUM; i++) {
r = imgu_v4l2_node_setup(imgu, pipe, i);
- if (r)
- goto cleanup;
+ 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)
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Outreachy kernel] [PATCH] media: staging/intel-ipu3: Simplify single goto jump
2020-03-22 21:42 [PATCH] media: staging/intel-ipu3: Simplify single goto jump Deepak R Varma
@ 2020-03-23 0:50 ` Stefano Brivio
0 siblings, 0 replies; 3+ messages in thread
From: Stefano Brivio @ 2020-03-23 0:50 UTC (permalink / raw)
To: Deepak R Varma
Cc: outreachy-kernel, gregkh, daniel.baluta, kieran.bingham,
Sakari Ailus, Mauro Carvalho Chehab
On Mon, 23 Mar 2020 03:12:06 +0530
Deepak R Varma <mh12gx2825@gmail.com> wrote:
> 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>
--
Stefano
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] media: staging/intel-ipu3: Simplify single goto jump
@ 2020-03-25 21:00 Deepak R Varma
0 siblings, 0 replies; 3+ messages in thread
From: Deepak R Varma @ 2020-03-25 21:00 UTC (permalink / raw)
To: outreachy-kernel, gregkh, daniel.baluta, kieran.bingham
Cc: Sakari Ailus, Mauro Carvalho Chehab, linux-media
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>
---
NOTE: Patch being resent. Adding linux-media list as suggested by Sakari
Ailus. No changes since last version.
drivers/staging/media/ipu3/ipu3-v4l2.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/media/ipu3/ipu3-v4l2.c b/drivers/staging/media/ipu3/ipu3-v4l2.c
index e8f33539a217..bd8cb7571038 100644
--- a/drivers/staging/media/ipu3/ipu3-v4l2.c
+++ b/drivers/staging/media/ipu3/ipu3-v4l2.c
@@ -1295,15 +1295,13 @@ static int imgu_v4l2_nodes_setup_pipe(struct imgu_device *imgu, int pipe)
for (i = 0; i < IMGU_NODE_NUM; i++) {
r = imgu_v4l2_node_setup(imgu, pipe, i);
- if (r)
- goto cleanup;
+ 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)
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-03-25 21:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-22 21:42 [PATCH] media: staging/intel-ipu3: Simplify single goto jump Deepak R Varma
2020-03-23 0:50 ` [Outreachy kernel] " Stefano Brivio
-- strict thread matches above, loose matches on Subject: below --
2020-03-25 21:00 Deepak R Varma
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.