linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 media-next] media: rkisp1: Fix unused value issue
@ 2024-11-19  7:26 Dheeraj Reddy Jonnalagadda
  2024-11-19  7:59 ` Laurent Pinchart
  0 siblings, 1 reply; 5+ messages in thread
From: Dheeraj Reddy Jonnalagadda @ 2024-11-19  7:26 UTC (permalink / raw)
  To: dafna, laurent.pinchart, linux-media
  Cc: mchehab, heiko, linux-rockchip, linux-arm-kernel, linux-kernel,
	Dheeraj Reddy Jonnalagadda

This commit fixes an unused value issue detected by Coverity (CID
1519008). The error condition for the invalid MIPI CSI-2 is not
properly handled as the break statement would only exit the switch block
and not the entire loop. Fixed this by returning the error immediately
after the switch block.

'Fixes: 8d4f126fde89 ("media: rkisp1: Make the internal CSI-2 receiver
optional")'

Signed-off-by: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
---
 drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
index dd114ab77800..9ad5026ab10a 100644
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
@@ -228,6 +228,9 @@ static int rkisp1_subdev_notifier_register(struct rkisp1_device *rkisp1)
 			break;
 		}
 
+		if (ret)
+			break;
+
 		/* Parse the endpoint and validate the bus type. */
 		ret = v4l2_fwnode_endpoint_parse(ep, &vep);
 		if (ret) {
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v4 media-next] media: rkisp1: Fix unused value issue
  2024-11-19  7:26 [PATCH v4 media-next] media: rkisp1: Fix unused value issue Dheeraj Reddy Jonnalagadda
@ 2024-11-19  7:59 ` Laurent Pinchart
  2024-11-19  8:44   ` Jacopo Mondi
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Laurent Pinchart @ 2024-11-19  7:59 UTC (permalink / raw)
  To: Dheeraj Reddy Jonnalagadda
  Cc: dafna, linux-media, mchehab, heiko, linux-rockchip,
	linux-arm-kernel, linux-kernel

Hi Dheeraj,

Thank you for the patch.

On Tue, Nov 19, 2024 at 12:56:53PM +0530, Dheeraj Reddy Jonnalagadda wrote:
> This commit fixes an unused value issue detected by Coverity (CID
> 1519008). The error condition for the invalid MIPI CSI-2 is not
> properly handled as the break statement would only exit the switch block
> and not the entire loop. Fixed this by returning the error immediately
> after the switch block.

The patch doesn't "return immediately". You can write "Fix this by
breaking from the look immediately after the switch block when an error
occurs." or something similar.

> 
> 'Fixes: 8d4f126fde89 ("media: rkisp1: Make the internal CSI-2 receiver
> optional")'

The Fixes tag should be formatted on a single line, without outer
quotes, and without a blank line between it and the Signed-off-by line:

Fixes: 8d4f126fde89 ("media: rkisp1: Make the internal CSI-2 receiver optional")

> Signed-off-by: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>

I can update the commit message when applying the patch, there's no need
to submit a v5, unless if you want to. Please let me know if I should
take this version and update the commit message, or if you will send a
v5.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
> index dd114ab77800..9ad5026ab10a 100644
> --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
> +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
> @@ -228,6 +228,9 @@ static int rkisp1_subdev_notifier_register(struct rkisp1_device *rkisp1)
>  			break;
>  		}
>  
> +		if (ret)
> +			break;
> +
>  		/* Parse the endpoint and validate the bus type. */
>  		ret = v4l2_fwnode_endpoint_parse(ep, &vep);
>  		if (ret) {

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v4 media-next] media: rkisp1: Fix unused value issue
  2024-11-19  7:59 ` Laurent Pinchart
@ 2024-11-19  8:44   ` Jacopo Mondi
  2024-11-19  9:34   ` Dheeraj Reddy Jonnalagadda
  2024-12-04 17:04   ` Laurent Pinchart
  2 siblings, 0 replies; 5+ messages in thread
From: Jacopo Mondi @ 2024-11-19  8:44 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Dheeraj Reddy Jonnalagadda, dafna, linux-media, mchehab, heiko,
	linux-rockchip, linux-arm-kernel, linux-kernel

HI Dheeraj

On Tue, Nov 19, 2024 at 09:59:44AM +0200, Laurent Pinchart wrote:
> Hi Dheeraj,
>
> Thank you for the patch.
>
> On Tue, Nov 19, 2024 at 12:56:53PM +0530, Dheeraj Reddy Jonnalagadda wrote:
> > This commit fixes an unused value issue detected by Coverity (CID
> > 1519008). The error condition for the invalid MIPI CSI-2 is not
> > properly handled as the break statement would only exit the switch block
> > and not the entire loop. Fixed this by returning the error immediately
> > after the switch block.
>
> The patch doesn't "return immediately". You can write "Fix this by
> breaking from the look immediately after the switch block when an error
> occurs." or something similar.
>
> >
> > 'Fixes: 8d4f126fde89 ("media: rkisp1: Make the internal CSI-2 receiver
> > optional")'
>
> The Fixes tag should be formatted on a single line, without outer
> quotes, and without a blank line between it and the Signed-off-by line:
>
> Fixes: 8d4f126fde89 ("media: rkisp1: Make the internal CSI-2 receiver optional")
>
> > Signed-off-by: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
>
> I can update the commit message when applying the patch, there's no need
> to submit a v5, unless if you want to. Please let me know if I should
> take this version and update the commit message, or if you will send a
> v5.
>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

And when you receive a tag in a previous patch version, please carry
it over to the next version you'll send ;)

Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

Thanks
  j

>
> > ---
> >  drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
> > index dd114ab77800..9ad5026ab10a 100644
> > --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
> > +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
> > @@ -228,6 +228,9 @@ static int rkisp1_subdev_notifier_register(struct rkisp1_device *rkisp1)
> >  			break;
> >  		}
> >
> > +		if (ret)
> > +			break;
> > +
> >  		/* Parse the endpoint and validate the bus type. */
> >  		ret = v4l2_fwnode_endpoint_parse(ep, &vep);
> >  		if (ret) {
>
> --
> Regards,
>
> Laurent Pinchart
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v4 media-next] media: rkisp1: Fix unused value issue
  2024-11-19  7:59 ` Laurent Pinchart
  2024-11-19  8:44   ` Jacopo Mondi
@ 2024-11-19  9:34   ` Dheeraj Reddy Jonnalagadda
  2024-12-04 17:04   ` Laurent Pinchart
  2 siblings, 0 replies; 5+ messages in thread
From: Dheeraj Reddy Jonnalagadda @ 2024-11-19  9:34 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: dafna, linux-media, mchehab, heiko, linux-rockchip,
	linux-arm-kernel, linux-kernel

On Tue, Nov 19, 2024 at 09:59:44AM +0200, Laurent Pinchart wrote:
> Hi Dheeraj,
> 
> Thank you for the patch.
> 
> On Tue, Nov 19, 2024 at 12:56:53PM +0530, Dheeraj Reddy Jonnalagadda wrote:
> > This commit fixes an unused value issue detected by Coverity (CID
> > 1519008). The error condition for the invalid MIPI CSI-2 is not
> > properly handled as the break statement would only exit the switch block
> > and not the entire loop. Fixed this by returning the error immediately
> > after the switch block.
> 
> The patch doesn't "return immediately". You can write "Fix this by
> breaking from the look immediately after the switch block when an error
> occurs." or something similar.
> 
> > 
> > 'Fixes: 8d4f126fde89 ("media: rkisp1: Make the internal CSI-2 receiver
> > optional")'
> 
> The Fixes tag should be formatted on a single line, without outer
> quotes, and without a blank line between it and the Signed-off-by line:
> 
> Fixes: 8d4f126fde89 ("media: rkisp1: Make the internal CSI-2 receiver optional")
> 
> > Signed-off-by: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
> 
> I can update the commit message when applying the patch, there's no need
> to submit a v5, unless if you want to. Please let me know if I should
> take this version and update the commit message, or if you will send a
> v5.
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> > ---
> >  drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
> > index dd114ab77800..9ad5026ab10a 100644
> > --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
> > +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
> > @@ -228,6 +228,9 @@ static int rkisp1_subdev_notifier_register(struct rkisp1_device *rkisp1)
> >  			break;
> >  		}
> >  
> > +		if (ret)
> > +			break;
> > +
> >  		/* Parse the endpoint and validate the bus type. */
> >  		ret = v4l2_fwnode_endpoint_parse(ep, &vep);
> >  		if (ret) {
> 
> -- 
> Regards,
> 
> Laurent Pinchart
Hi Laurent,

Please go ahead and take this version and apply the patch with the updated 
commit message.

Thank you and Jacopo for your valuable comments. As a new contributor, 
your feedback is extremely helpful.

-Dheeraj


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v4 media-next] media: rkisp1: Fix unused value issue
  2024-11-19  7:59 ` Laurent Pinchart
  2024-11-19  8:44   ` Jacopo Mondi
  2024-11-19  9:34   ` Dheeraj Reddy Jonnalagadda
@ 2024-12-04 17:04   ` Laurent Pinchart
  2 siblings, 0 replies; 5+ messages in thread
From: Laurent Pinchart @ 2024-12-04 17:04 UTC (permalink / raw)
  To: Dheeraj Reddy Jonnalagadda
  Cc: dafna, linux-media, mchehab, heiko, linux-rockchip,
	linux-arm-kernel, linux-kernel

On Tue, Nov 19, 2024 at 09:59:44AM +0200, Laurent Pinchart wrote:
> Hi Dheeraj,
> 
> Thank you for the patch.
> 
> On Tue, Nov 19, 2024 at 12:56:53PM +0530, Dheeraj Reddy Jonnalagadda wrote:
> > This commit fixes an unused value issue detected by Coverity (CID
> > 1519008). The error condition for the invalid MIPI CSI-2 is not
> > properly handled as the break statement would only exit the switch block
> > and not the entire loop. Fixed this by returning the error immediately
> > after the switch block.
> 
> The patch doesn't "return immediately". You can write "Fix this by
> breaking from the look immediately after the switch block when an error
> occurs." or something similar.
> 
> > 'Fixes: 8d4f126fde89 ("media: rkisp1: Make the internal CSI-2 receiver
> > optional")'
> 
> The Fixes tag should be formatted on a single line, without outer
> quotes, and without a blank line between it and the Signed-off-by line:
> 
> Fixes: 8d4f126fde89 ("media: rkisp1: Make the internal CSI-2 receiver optional")

That commit ID doesn't exist in the git history. The commit
corresponding to the message is 7d4f126fde89. I'll update the commit
message accordingly.

> > Signed-off-by: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
> 
> I can update the commit message when applying the patch, there's no need
> to submit a v5, unless if you want to. Please let me know if I should
> take this version and update the commit message, or if you will send a
> v5.
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> > ---
> >  drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
> > index dd114ab77800..9ad5026ab10a 100644
> > --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
> > +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
> > @@ -228,6 +228,9 @@ static int rkisp1_subdev_notifier_register(struct rkisp1_device *rkisp1)
> >  			break;
> >  		}
> >  
> > +		if (ret)
> > +			break;
> > +
> >  		/* Parse the endpoint and validate the bus type. */
> >  		ret = v4l2_fwnode_endpoint_parse(ep, &vep);
> >  		if (ret) {

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-12-04 17:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-19  7:26 [PATCH v4 media-next] media: rkisp1: Fix unused value issue Dheeraj Reddy Jonnalagadda
2024-11-19  7:59 ` Laurent Pinchart
2024-11-19  8:44   ` Jacopo Mondi
2024-11-19  9:34   ` Dheeraj Reddy Jonnalagadda
2024-12-04 17:04   ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).