[libcamera-devel] ipa: ipu3: fix coverity issues in AWB
diff mbox series

Message ID 20210422124123.113903-1-jeanmichel.hautbois@ideasonboard.com
State Accepted
Commit 7e0da7c34900cb219ee447df547162211d8683e3
Headers show
Series
  • [libcamera-devel] ipa: ipu3: fix coverity issues in AWB
Related show

Commit Message

Jean-Michel Hautbois April 22, 2021, 12:41 p.m. UTC
This patch fixes two minor issues detected by converity after merging in
master.

Reported-by: Coverity CID=320056
Reported-by: Coverity CID=320058
Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
---
 src/ipa/ipu3/ipu3_awb.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Kieran Bingham April 22, 2021, 12:59 p.m. UTC | #1
Hi JM,

On 22/04/2021 13:41, Jean-Michel Hautbois wrote:
> This patch fixes two minor issues detected by converity after merging in
> master.

Perhaps we can describe the patch rather than what caused it to be created?

"The BNR configuration structure has inconsistent initialisation of two
members.

This was picked up by Coverity, after merge.
While this code is still functional, fix them to be consistent with the
other initialisations within the struct."


For the code change,

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
--
Kieran


> Reported-by: Coverity CID=320056
> Reported-by: Coverity CID=320058
> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
> ---
>  src/ipa/ipu3/ipu3_awb.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/ipa/ipu3/ipu3_awb.cpp b/src/ipa/ipu3/ipu3_awb.cpp
> index 060d1e18..f8788065 100644
> --- a/src/ipa/ipu3/ipu3_awb.cpp
> +++ b/src/ipa/ipu3/ipu3_awb.cpp
> @@ -96,14 +96,14 @@ static const struct ipu3_uapi_bnr_static_config imguCssBnrDefaults = {
>  	.wb_gains_thr = { 255, 255, 255, 255 },
>  	.thr_coeffs = { 1700, 0, 31, 31, 0, 16 },
>  	.thr_ctrl_shd = { 26, 26, 26, 26 },
> -	.opt_center{ -648, 0, -366, 0 },
> +	.opt_center = { -648, 0, -366, 0 },
>  	.lut = {
>  		{ 17, 23, 28, 32, 36, 39, 42, 45,
>  		  48, 51, 53, 55, 58, 60, 62, 64,
>  		  66, 68, 70, 72, 73, 75, 77, 78,
>  		  80, 82, 83, 85, 86, 88, 89, 90 } },
>  	.bp_ctrl = { 20, 0, 1, 40, 0, 6, 0, 6, 0 },
> -	.dn_detect_ctrl{ 9, 3, 4, 0, 8, 0, 1, 1, 1, 1, 0 },
> +	.dn_detect_ctrl = { 9, 3, 4, 0, 8, 0, 1, 1, 1, 1, 0 },
>  	.column_size = 1296,
>  	.opt_center_sqr = { 419904, 133956 },
>  };
>
Niklas Söderlund April 22, 2021, 2:34 p.m. UTC | #2
Hi Jean-Michel,

Nice work, this fixes gcc7 compilation for me.

On 2021-04-22 14:41:23 +0200, Jean-Michel Hautbois wrote:
> This patch fixes two minor issues detected by converity after merging in
> master.
> 
> Reported-by: Coverity CID=320056
> Reported-by: Coverity CID=320058
> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>

Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

> ---
>  src/ipa/ipu3/ipu3_awb.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/ipa/ipu3/ipu3_awb.cpp b/src/ipa/ipu3/ipu3_awb.cpp
> index 060d1e18..f8788065 100644
> --- a/src/ipa/ipu3/ipu3_awb.cpp
> +++ b/src/ipa/ipu3/ipu3_awb.cpp
> @@ -96,14 +96,14 @@ static const struct ipu3_uapi_bnr_static_config imguCssBnrDefaults = {
>  	.wb_gains_thr = { 255, 255, 255, 255 },
>  	.thr_coeffs = { 1700, 0, 31, 31, 0, 16 },
>  	.thr_ctrl_shd = { 26, 26, 26, 26 },
> -	.opt_center{ -648, 0, -366, 0 },
> +	.opt_center = { -648, 0, -366, 0 },
>  	.lut = {
>  		{ 17, 23, 28, 32, 36, 39, 42, 45,
>  		  48, 51, 53, 55, 58, 60, 62, 64,
>  		  66, 68, 70, 72, 73, 75, 77, 78,
>  		  80, 82, 83, 85, 86, 88, 89, 90 } },
>  	.bp_ctrl = { 20, 0, 1, 40, 0, 6, 0, 6, 0 },
> -	.dn_detect_ctrl{ 9, 3, 4, 0, 8, 0, 1, 1, 1, 1, 0 },
> +	.dn_detect_ctrl = { 9, 3, 4, 0, 8, 0, 1, 1, 1, 1, 0 },
>  	.column_size = 1296,
>  	.opt_center_sqr = { 419904, 133956 },
>  };
> -- 
> 2.27.0
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
Laurent Pinchart April 22, 2021, 3:08 p.m. UTC | #3
On Thu, Apr 22, 2021 at 04:34:47PM +0200, Niklas Söderlund wrote:
> Hi Jean-Michel,
> 
> Nice work, this fixes gcc7 compilation for me.

And with clang-9 too.

With a better commit message as mentioned by Kieran,

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

> On 2021-04-22 14:41:23 +0200, Jean-Michel Hautbois wrote:
> > This patch fixes two minor issues detected by converity after merging in
> > master.
> > 
> > Reported-by: Coverity CID=320056
> > Reported-by: Coverity CID=320058
> > Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
> 
> Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
> 
> > ---
> >  src/ipa/ipu3/ipu3_awb.cpp | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/src/ipa/ipu3/ipu3_awb.cpp b/src/ipa/ipu3/ipu3_awb.cpp
> > index 060d1e18..f8788065 100644
> > --- a/src/ipa/ipu3/ipu3_awb.cpp
> > +++ b/src/ipa/ipu3/ipu3_awb.cpp
> > @@ -96,14 +96,14 @@ static const struct ipu3_uapi_bnr_static_config imguCssBnrDefaults = {
> >  	.wb_gains_thr = { 255, 255, 255, 255 },
> >  	.thr_coeffs = { 1700, 0, 31, 31, 0, 16 },
> >  	.thr_ctrl_shd = { 26, 26, 26, 26 },
> > -	.opt_center{ -648, 0, -366, 0 },
> > +	.opt_center = { -648, 0, -366, 0 },
> >  	.lut = {
> >  		{ 17, 23, 28, 32, 36, 39, 42, 45,
> >  		  48, 51, 53, 55, 58, 60, 62, 64,
> >  		  66, 68, 70, 72, 73, 75, 77, 78,
> >  		  80, 82, 83, 85, 86, 88, 89, 90 } },
> >  	.bp_ctrl = { 20, 0, 1, 40, 0, 6, 0, 6, 0 },
> > -	.dn_detect_ctrl{ 9, 3, 4, 0, 8, 0, 1, 1, 1, 1, 0 },
> > +	.dn_detect_ctrl = { 9, 3, 4, 0, 8, 0, 1, 1, 1, 1, 0 },
> >  	.column_size = 1296,
> >  	.opt_center_sqr = { 419904, 133956 },
> >  };

Patch
diff mbox series

diff --git a/src/ipa/ipu3/ipu3_awb.cpp b/src/ipa/ipu3/ipu3_awb.cpp
index 060d1e18..f8788065 100644
--- a/src/ipa/ipu3/ipu3_awb.cpp
+++ b/src/ipa/ipu3/ipu3_awb.cpp
@@ -96,14 +96,14 @@  static const struct ipu3_uapi_bnr_static_config imguCssBnrDefaults = {
 	.wb_gains_thr = { 255, 255, 255, 255 },
 	.thr_coeffs = { 1700, 0, 31, 31, 0, 16 },
 	.thr_ctrl_shd = { 26, 26, 26, 26 },
-	.opt_center{ -648, 0, -366, 0 },
+	.opt_center = { -648, 0, -366, 0 },
 	.lut = {
 		{ 17, 23, 28, 32, 36, 39, 42, 45,
 		  48, 51, 53, 55, 58, 60, 62, 64,
 		  66, 68, 70, 72, 73, 75, 77, 78,
 		  80, 82, 83, 85, 86, 88, 89, 90 } },
 	.bp_ctrl = { 20, 0, 1, 40, 0, 6, 0, 6, 0 },
-	.dn_detect_ctrl{ 9, 3, 4, 0, 8, 0, 1, 1, 1, 1, 0 },
+	.dn_detect_ctrl = { 9, 3, 4, 0, 8, 0, 1, 1, 1, 1, 0 },
 	.column_size = 1296,
 	.opt_center_sqr = { 419904, 133956 },
 };