[libcamera-devel] ipa: rkisp1: Initialize numCells in constructor
diff mbox series

Message ID 20211130064547.37598-1-jeanmichel.hautbois@ideasonboard.com
State Superseded
Headers show
Series
  • [libcamera-devel] ipa: rkisp1: Initialize numCells in constructor
Related show

Commit Message

Jean-Michel Hautbois Nov. 30, 2021, 6:45 a.m. UTC
The non-static class member "numCells_" is not initialized in the
constructor, leading to a coverity scan report (UNINIT_CTOR).

Fix it.

Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
---
 src/ipa/rkisp1/algorithms/agc.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Umang Jain Nov. 30, 2021, 7:02 a.m. UTC | #1
Hi JM,

On 11/30/21 12:15 PM, Jean-Michel Hautbois wrote:
> The non-static class member "numCells_" is not initialized in the
> constructor, leading to a coverity scan report (UNINIT_CTOR).
>
> Fix it.


Usually we should also mention the report as per:

     $ git log --grep=Coverity | grep CID

     Reported-by: Coverity CID=361652
     Reported-by: Coverity CID=354657
     ...


Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>

> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
> ---
>   src/ipa/rkisp1/algorithms/agc.cpp | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp
> index 650fe2dae..d6abdc310 100644
> --- a/src/ipa/rkisp1/algorithms/agc.cpp
> +++ b/src/ipa/rkisp1/algorithms/agc.cpp
> @@ -53,7 +53,7 @@ static constexpr uint32_t kNumStartupFrames = 10;
>   static constexpr double kRelativeLuminanceTarget = 0.4;
>   
>   Agc::Agc()
> -	: frameCount_(0), filteredExposure_(0s)
> +	: frameCount_(0), numCells_(0), filteredExposure_(0s)
>   {
>   }
>
Jean-Michel Hautbois Nov. 30, 2021, 7:11 a.m. UTC | #2
Hi Umang,

On 30/11/2021 08:02, Umang Jain wrote:
> Hi JM,
> 
> On 11/30/21 12:15 PM, Jean-Michel Hautbois wrote:
>> The non-static class member "numCells_" is not initialized in the
>> constructor, leading to a coverity scan report (UNINIT_CTOR).
>>
>> Fix it.
> 
> 
> Usually we should also mention the report as per:
> 
>      $ git log --grep=Coverity | grep CID
> 
>      Reported-by: Coverity CID=361652
>      Reported-by: Coverity CID=354657
>      ...
> 
> 
> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>

Thanks, fixed the reported-by in v1.1 ;-).

> 
>> Signed-off-by: Jean-Michel Hautbois 
>> <jeanmichel.hautbois@ideasonboard.com>
>> ---
>>   src/ipa/rkisp1/algorithms/agc.cpp | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp 
>> b/src/ipa/rkisp1/algorithms/agc.cpp
>> index 650fe2dae..d6abdc310 100644
>> --- a/src/ipa/rkisp1/algorithms/agc.cpp
>> +++ b/src/ipa/rkisp1/algorithms/agc.cpp
>> @@ -53,7 +53,7 @@ static constexpr uint32_t kNumStartupFrames = 10;
>>   static constexpr double kRelativeLuminanceTarget = 0.4;
>>   Agc::Agc()
>> -    : frameCount_(0), filteredExposure_(0s)
>> +    : frameCount_(0), numCells_(0), filteredExposure_(0s)
>>   {
>>   }

Patch
diff mbox series

diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp
index 650fe2dae..d6abdc310 100644
--- a/src/ipa/rkisp1/algorithms/agc.cpp
+++ b/src/ipa/rkisp1/algorithms/agc.cpp
@@ -53,7 +53,7 @@  static constexpr uint32_t kNumStartupFrames = 10;
 static constexpr double kRelativeLuminanceTarget = 0.4;
 
 Agc::Agc()
-	: frameCount_(0), filteredExposure_(0s)
+	: frameCount_(0), numCells_(0), filteredExposure_(0s)
 {
 }