pipeline: rpi: pisp: Fix uninitialized variable warning
diff mbox series

Message ID 20250320160521.301-1-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • pipeline: rpi: pisp: Fix uninitialized variable warning
Related show

Commit Message

Laurent Pinchart March 20, 2025, 4:05 p.m. UTC
gcc 13.3.0 from buildroot 2024.11.1 complains about an uninitialized
variable. This is a false positive as the cfe_ array can't be empty.
Nonetheless, it breaks builds, so initialize the variable to work around
the issue.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/libcamera/pipeline/rpi/pisp/pisp.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 841ef2b4bb08ba48470817ff1f838efcce377fee
--
Regards,

Laurent Pinchart

Comments

Naushir Patuck March 20, 2025, 4:07 p.m. UTC | #1
Hi Laurent,

Thanks for fixing this.

On Thu, 20 Mar 2025 at 16:05, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> gcc 13.3.0 from buildroot 2024.11.1 complains about an uninitialized
> variable. This is a false positive as the cfe_ array can't be empty.
> Nonetheless, it breaks builds, so initialize the variable to work around
> the issue.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Naushir Patuck <naush@raspberrypi.com>

> ---
>  src/libcamera/pipeline/rpi/pisp/pisp.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/libcamera/pipeline/rpi/pisp/pisp.cpp b/src/libcamera/pipeline/rpi/pisp/pisp.cpp
> index 0f9e332667c0..42ca7c80b10a 100644
> --- a/src/libcamera/pipeline/rpi/pisp/pisp.cpp
> +++ b/src/libcamera/pipeline/rpi/pisp/pisp.cpp
> @@ -1700,7 +1700,7 @@ void PiSPCameraData::platformFreeBuffers()
>  void PiSPCameraData::cfeBufferDequeue(FrameBuffer *buffer)
>  {
>         RPi::Stream *stream = nullptr;
> -       int index;
> +       int index = 0;
>
>         if (!isRunning())
>                 return;
>
> base-commit: 841ef2b4bb08ba48470817ff1f838efcce377fee
> --
> Regards,
>
> Laurent Pinchart
>
Kieran Bingham March 20, 2025, 4:11 p.m. UTC | #2
Quoting Naushir Patuck (2025-03-20 16:07:28)
> Hi Laurent,
> 
> Thanks for fixing this.
> 
> On Thu, 20 Mar 2025 at 16:05, Laurent Pinchart
> <laurent.pinchart@ideasonboard.com> wrote:
> >
> > gcc 13.3.0 from buildroot 2024.11.1 complains about an uninitialized
> > variable. This is a false positive as the cfe_ array can't be empty.
> > Nonetheless, it breaks builds, so initialize the variable to work around
> > the issue.
> >
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
> 

Yup, lets keep the compiler happy...

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

> > ---
> >  src/libcamera/pipeline/rpi/pisp/pisp.cpp | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/libcamera/pipeline/rpi/pisp/pisp.cpp b/src/libcamera/pipeline/rpi/pisp/pisp.cpp
> > index 0f9e332667c0..42ca7c80b10a 100644
> > --- a/src/libcamera/pipeline/rpi/pisp/pisp.cpp
> > +++ b/src/libcamera/pipeline/rpi/pisp/pisp.cpp
> > @@ -1700,7 +1700,7 @@ void PiSPCameraData::platformFreeBuffers()
> >  void PiSPCameraData::cfeBufferDequeue(FrameBuffer *buffer)
> >  {
> >         RPi::Stream *stream = nullptr;
> > -       int index;
> > +       int index = 0;
> >
> >         if (!isRunning())
> >                 return;
> >
> > base-commit: 841ef2b4bb08ba48470817ff1f838efcce377fee
> > --
> > Regards,
> >
> > Laurent Pinchart
> >

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/rpi/pisp/pisp.cpp b/src/libcamera/pipeline/rpi/pisp/pisp.cpp
index 0f9e332667c0..42ca7c80b10a 100644
--- a/src/libcamera/pipeline/rpi/pisp/pisp.cpp
+++ b/src/libcamera/pipeline/rpi/pisp/pisp.cpp
@@ -1700,7 +1700,7 @@  void PiSPCameraData::platformFreeBuffers()
 void PiSPCameraData::cfeBufferDequeue(FrameBuffer *buffer)
 {
 	RPi::Stream *stream = nullptr;
-	int index;
+	int index = 0;

 	if (!isRunning())
 		return;