media: staging/intel-ipu3: Simplify single goto jump
Subsystems (3)
PATCH 1/1 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 <[email protected]>
Reviewed-by Stefano Brivio <[email protected]>
---
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(-)
drivers/staging/media/ipu3/ipu3-v4l2.c +4 -6
@@ -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)
Signature · 1 line
2.17.1