From: Deepak R Varma <mh12gx2825@gmail.com>
To: outreachy-kernel@googlegroups.com, gregkh@linuxfoundation.org,
daniel.baluta@gmail.com, kieran.bingham@ideasonboard.com
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [PATCH] media: staging/intel-ipu3: Simplify single goto jump
Date: Mon, 23 Mar 2020 03:12:06 +0530 [thread overview]
Message-ID: <20200322214203.GA20307@deeUbuntu> (raw)
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
next reply other threads:[~2020-03-22 21:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-22 21:42 Deepak R Varma [this message]
2020-03-23 0:50 ` [Outreachy kernel] [PATCH] media: staging/intel-ipu3: Simplify single goto jump Stefano Brivio
-- strict thread matches above, loose matches on Subject: below --
2020-03-25 21:00 Deepak R Varma
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200322214203.GA20307@deeUbuntu \
--to=mh12gx2825@gmail.com \
--cc=daniel.baluta@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=kieran.bingham@ideasonboard.com \
--cc=mchehab@kernel.org \
--cc=outreachy-kernel@googlegroups.com \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.