media: vsp1: Simplify DRM UIF handling
PATCH 1/1 media: vsp1: Simplify DRM UIF handling
From: Kieran Bingham <[email protected]>
In commit 6732f3139380 ("media: v4l: vsp1: Fix uif null pointer access") the handling of the UIF was over complicated, and the patch applied before review.
Simplify it to keep the conditionals small.
---
Another one that I had lying around in my tree for too long ....
drivers/media/platform/vsp1/vsp1_drm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/media/platform/vsp1/vsp1_drm.c +6 -2
@@ -455,6 +455,10 @@ static int vsp1_du_pipeline_setup_inputs(struct vsp1_device *vsp1,dev_err (vsp1->dev,"%s: failed to setup UIF after %s\n" , __func__,BRX_NAME (pipe->brx)); +/* If the DRM pipe does not have a UIF there is nothing we can update. */ +if (!drm_pipe->uif) +return 0 ; +/* * If the UIF is not in use schedule it for removal by setting its pipe * pointer to NULL, vsp1_du_pipeline_configure() will remove it from the
@@ -462,9 +466,9 @@ static int vsp1_du_pipeline_setup_inputs(struct vsp1_device *vsp1,* make sure it is present in the pipeline's list of entities if it * wasn't already. */ -if (drm_pipe->uif && !use_uif) { +if (!use_uif) { drm_pipe->uif->pipe =NULL ; - }else if (drm_pipe->uif && !drm_pipe->uif->pipe) { + }else if (!drm_pipe->uif->pipe) { drm_pipe->uif->pipe = pipe;list_add_tail (&drm_pipe->uif->list_pipe, &pipe->entities); }
Signature · 1 line
2.30.2
Hi Kieran,
Thank you for the patch.
Quoted 6 lines · Kieran Bingham
From: Kieran Bingham <[email protected]>
In commit
6732f3139380("media: v4l: vsp1: Fix uif null pointer access") the handling of the UIF was over complicated, and the patch applied before review.
Quoted 6 lines
Simplify it to keep the conditionals small.
Signed-off-by Kieran Bingham <[email protected]>---
Another one that I had lying around in my tree for too long ....
It seems to have survived bitrot quite well.
Quoted 30 lines
drivers/media/platform/vsp1/vsp1_drm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/media/platform/vsp1/vsp1_drm.c +6
-2@@ -455,6 +455,10 @@ static int vsp1_du_pipeline_setup_inputs(struct vsp1_device *vsp1,dev_err (vsp1->dev,"%s: failed to setup UIF after %s\n" , __func__,BRX_NAME (pipe->brx)); +/* If the DRM pipe does not have a UIF there is nothing we can update. */ +if (!drm_pipe->uif) +return 0 ; +/* * If the UIF is not in use schedule it for removal by setting its pipe * pointer to NULL, vsp1_du_pipeline_configure() will remove it from the @@ -462,9 +466,9 @@ static int vsp1_du_pipeline_setup_inputs(struct vsp1_device *vsp1,* make sure it is present in the pipeline's list of entities if it * wasn't already. */ -if (drm_pipe->uif && !use_uif) { +if (!use_uif) { drm_pipe->uif->pipe =NULL ; - }else if (drm_pipe->uif && !drm_pipe->uif->pipe) { + }else if (!drm_pipe->uif->pipe) { drm_pipe->uif->pipe = pipe;list_add_tail (&drm_pipe->uif->list_pipe, &pipe->entities); }
Signature · 3 lines
Regards, Laurent Pinchart
Quoted 11 lines · Laurent Pinchart
Hi Kieran,
Thank you for the patch.
Quoted 6 lines · Kieran Bingham
From: Kieran Bingham <[email protected]>
In commit
6732f3139380("media: v4l: vsp1: Fix uif null pointer access") the handling of the UIF was over complicated, and the patch applied before review.
Quoted 8 lines
Quoted 6 lines
Simplify it to keep the conditionals small.
Signed-off-by Kieran Bingham <[email protected]>---
Another one that I had lying around in my tree for too long ....
It seems to have survived bitrot quite well.
This still applies with git am to my tree here ...
Quoted 1 line
Reviewed-by Laurent Pinchart <[email protected]>
Thanks, do I need to do anything else to progress this ?
--
Kieran
Quoted 32 lines
Quoted 31 lines
drivers/media/platform/vsp1/vsp1_drm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/media/platform/vsp1/vsp1_drm.c +6
-2@@ -455,6 +455,10 @@ static int vsp1_du_pipeline_setup_inputs(struct vsp1_device *vsp1,dev_err (vsp1->dev,"%s: failed to setup UIF after %s\n" , __func__,BRX_NAME (pipe->brx)); +/* If the DRM pipe does not have a UIF there is nothing we can update. */ +if (!drm_pipe->uif) +return 0 ; +/* * If the UIF is not in use schedule it for removal by setting its pipe * pointer to NULL, vsp1_du_pipeline_configure() will remove it from the @@ -462,9 +466,9 @@ static int vsp1_du_pipeline_setup_inputs(struct vsp1_device *vsp1,* make sure it is present in the pipeline's list of entities if it * wasn't already. */ -if (drm_pipe->uif && !use_uif) { +if (!use_uif) { drm_pipe->uif->pipe =NULL ; - }else if (drm_pipe->uif && !drm_pipe->uif->pipe) { + }else if (!drm_pipe->uif->pipe) { drm_pipe->uif->pipe = pipe;list_add_tail (&drm_pipe->uif->list_pipe, &pipe->entities); }
Hi Kieran,
Quoted 15 lines · Kieran Bingham
Quoted 14 lines · Laurent Pinchart
Quoted 12 lines · Kieran Bingham
From: Kieran Bingham <[email protected]>
In commit
6732f3139380("media: v4l: vsp1: Fix uif null pointer access") the handling of the UIF was over complicated, and the patch applied before review.Simplify it to keep the conditionals small.
Signed-off-by Kieran Bingham <[email protected]>---
Another one that I had lying around in my tree for too long ....
Quoted 7 lines
Quoted 1 line
It seems to have survived bitrot quite well.
This still applies with git am to my tree here ...
Quoted 1 line
Reviewed-by Laurent Pinchart <[email protected]>Thanks, do I need to do anything else to progress this ?
You can ping me to remind me to send a pull request. Which you just did :-)
Quoted 30 lines
Quoted 30 lines
Quoted 30 lines
drivers/media/platform/vsp1/vsp1_drm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/media/platform/vsp1/vsp1_drm.c +6
-2@@ -455,6 +455,10 @@ static int vsp1_du_pipeline_setup_inputs(struct vsp1_device *vsp1,dev_err (vsp1->dev,"%s: failed to setup UIF after %s\n" , __func__,BRX_NAME (pipe->brx)); +/* If the DRM pipe does not have a UIF there is nothing we can update. */ +if (!drm_pipe->uif) +return 0 ; +/* * If the UIF is not in use schedule it for removal by setting its pipe * pointer to NULL, vsp1_du_pipeline_configure() will remove it from the @@ -462,9 +466,9 @@ static int vsp1_du_pipeline_setup_inputs(struct vsp1_device *vsp1,* make sure it is present in the pipeline's list of entities if it * wasn't already. */ -if (drm_pipe->uif && !use_uif) { +if (!use_uif) { drm_pipe->uif->pipe =NULL ; - }else if (drm_pipe->uif && !drm_pipe->uif->pipe) { + }else if (!drm_pipe->uif->pipe) { drm_pipe->uif->pipe = pipe;list_add_tail (&drm_pipe->uif->list_pipe, &pipe->entities); }
Signature · 3 lines
Regards, Laurent Pinchart
Hi Kieran,
Thanks for the patch.
Quoted 11 lines
Subject: [PATCH] media: vsp1: Simplify DRM UIF handling
From: Kieran Bingham <[email protected]>
In commit
6732f3139380("media: v4l: vsp1: Fix uif null pointer access") the handling of the UIF was over complicated, and the patch applied before review.Simplify it to keep the conditionals small.
Signed-off-by Kieran Bingham <[email protected]>
I forgot this. Thanks for taking care this.
Cheers,
Biju
Quoted 41 lines
---
Another one that I had lying around in my tree for too long ....
drivers/media/platform/vsp1/vsp1_drm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/media/platform/vsp1/vsp1_drm.c +1
-0@@ -455,6 +455,10 @@ static int vsp1_du_pipeline_setup_inputs(struct vsp1_device *vsp1,dev_err (vsp1->dev,"%s: failed to setup UIF after %s\n" , __func__,BRX_NAME (pipe->brx)); +/* If the DRM pipe does not have a UIF there is nothing we can update. */
drivers/media/platform/vsp1/vsp1_drm.c +3
-0+if (!drm_pipe->uif) +return 0 ; +/* * If the UIF is not in use schedule it for removal by setting its pipe
* pointer to NULL,vsp1_du_pipeline_configure()will remove it from
the @@ -462,9 +466,9 @@ static int vsp1_du_pipeline_setup_inputs(structvsp1_device*vsp1,drivers/media/platform/vsp1/vsp1_drm.c +2
-3* make sure it is present in the pipeline's list of entities if it * wasn't already. */ -if (drm_pipe->uif && !use_uif) { +if (!use_uif) { drm_pipe->uif->pipe =NULL ; - }else if (drm_pipe->uif && !drm_pipe->uif->pipe) { + }else if (!drm_pipe->uif->pipe) { drm_pipe->uif->pipe = pipe;list_add_tail (&drm_pipe->uif->list_pipe, &pipe->entities); } --2.30.2