[libcamera-devel,2/4] pipeline: raspberrypi: return an error if setFormat() fails
diff mbox series

Message ID 20201022081731.36217-2-tomi.valkeinen@iki.fi
State Accepted
Headers show
Series
  • [libcamera-devel,1/4] Add .clang-tidy
Related show

Commit Message

Tomi Valkeinen Oct. 22, 2020, 8:17 a.m. UTC
The method calls setFormat(), stores the return value, but then does not
do anything with the return value. I presume it is meant to fail and
return the error.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
---
 src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 2 ++
 1 file changed, 2 insertions(+)

Comments

Naushir Patuck Oct. 22, 2020, 8:38 a.m. UTC | #1
Hi Tomi,

Thank you for your patch.

On Thu, 22 Oct 2020 at 09:17, Tomi Valkeinen <tomi.valkeinen@iki.fi> wrote:

> The method calls setFormat(), stores the return value, but then does not
> do anything with the return value. I presume it is meant to fail and
> return the error.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
> ---
>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> index dd62dfc7..aa8d9340 100644
> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> @@ -586,6 +586,8 @@ int PipelineHandlerRPi::configure(Camera *camera,
> CameraConfiguration *config)
>          * because of flips in the sensor.
>          */
>         ret = data->isp_[Isp::Input].dev()->setFormat(&sensorFormat);
> +       if (ret)
> +               return ret;
>

Looks good to me.
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>


>
>         /*
>          * See which streams are requested, and route the user
> --
> 2.25.1
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
>
Kieran Bingham Oct. 22, 2020, 9:49 a.m. UTC | #2
Hi Tomi,

On 22/10/2020 09:17, Tomi Valkeinen wrote:
> The method calls setFormat(), stores the return value, but then does not
> do anything with the return value. I presume it is meant to fail and
> return the error.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>

Indeed, it looks that way to me.

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

> ---
>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> index dd62dfc7..aa8d9340 100644
> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> @@ -586,6 +586,8 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)
>  	 * because of flips in the sensor.
>  	 */
>  	ret = data->isp_[Isp::Input].dev()->setFormat(&sensorFormat);
> +	if (ret)
> +		return ret;
>  
>  	/*
>  	 * See which streams are requested, and route the user
>

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
index dd62dfc7..aa8d9340 100644
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
@@ -586,6 +586,8 @@  int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)
 	 * because of flips in the sensor.
 	 */
 	ret = data->isp_[Isp::Input].dev()->setFormat(&sensorFormat);
+	if (ret)
+		return ret;
 
 	/*
 	 * See which streams are requested, and route the user