[libcamera-devel] v4l2: camera_proxy: Fix compilation error use of undeclared identifier 'ret'

Message ID 20200108231518.1852151-1-niklas.soderlund@ragnatech.se
State Accepted
Commit 96eaad1238131721207c6a9bde077f7f1aad5f60
Headers show
Series
  • [libcamera-devel] v4l2: camera_proxy: Fix compilation error use of undeclared identifier 'ret'
Related show

Commit Message

Niklas Söderlund Jan. 8, 2020, 11:15 p.m. UTC
Refactoring of the camera_proxy have left the 'ret' variable undeclared,
declare it.

../../src/v4l2/v4l2_camera_proxy.cpp:273:2: error: use of undeclared identifier 'ret'
        ret = vcam_->invokeMethod(&V4L2Camera::configure,
        ^
../../src/v4l2/v4l2_camera_proxy.cpp:278:6: error: use of undeclared identifier 'ret'
        if (ret < 0)

Fixes: fce110c6d961c3bb ("v4l2: camera_proxy: Break out try_fmt")
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
---
 src/v4l2/v4l2_camera_proxy.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Jacopo Mondi Jan. 8, 2020, 11:23 p.m. UTC | #1
uuuups

On Thu, Jan 09, 2020 at 12:15:18AM +0100, Niklas Söderlund wrote:
> Refactoring of the camera_proxy have left the 'ret' variable undeclared,
> declare it.
>
> ../../src/v4l2/v4l2_camera_proxy.cpp:273:2: error: use of undeclared identifier 'ret'
>         ret = vcam_->invokeMethod(&V4L2Camera::configure,
>         ^
> ../../src/v4l2/v4l2_camera_proxy.cpp:278:6: error: use of undeclared identifier 'ret'
>         if (ret < 0)
>
> Fixes: fce110c6d961c3bb ("v4l2: camera_proxy: Break out try_fmt")
> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

Acked-by: Jacopo Mondi <jacopo@jmondi.org>

embarrassing indeed!

> ---
>  src/v4l2/v4l2_camera_proxy.cpp | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp
> index 89dd7166ca527bad..00d0d57172022138 100644
> --- a/src/v4l2/v4l2_camera_proxy.cpp
> +++ b/src/v4l2/v4l2_camera_proxy.cpp
> @@ -270,11 +270,11 @@ int V4L2CameraProxy::vidioc_s_fmt(struct v4l2_format *arg)
>  	tryFormat(arg);
>
>  	Size size(arg->fmt.pix.width, arg->fmt.pix.height);
> -	ret = vcam_->invokeMethod(&V4L2Camera::configure,
> -				  ConnectionTypeBlocking,
> -				  &streamConfig_, size,
> -				  v4l2ToDrm(arg->fmt.pix.pixelformat),
> -				  bufferCount_);
> +	int ret = vcam_->invokeMethod(&V4L2Camera::configure,
> +				      ConnectionTypeBlocking,
> +				      &streamConfig_, size,
> +				      v4l2ToDrm(arg->fmt.pix.pixelformat),
> +				      bufferCount_);
>  	if (ret < 0)
>  		return -EINVAL;
>
> --
> 2.24.1
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
Laurent Pinchart Jan. 8, 2020, 11:24 p.m. UTC | #2
Hi Niklas,

Thank you for the patch.

On Thu, Jan 09, 2020 at 12:15:18AM +0100, Niklas Söderlund wrote:
> Refactoring of the camera_proxy have left the 'ret' variable undeclared,
> declare it.
> 
> ../../src/v4l2/v4l2_camera_proxy.cpp:273:2: error: use of undeclared identifier 'ret'
>         ret = vcam_->invokeMethod(&V4L2Camera::configure,
>         ^
> ../../src/v4l2/v4l2_camera_proxy.cpp:278:6: error: use of undeclared identifier 'ret'
>         if (ret < 0)
> 
> Fixes: fce110c6d961c3bb ("v4l2: camera_proxy: Break out try_fmt")
> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

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

> ---
>  src/v4l2/v4l2_camera_proxy.cpp | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp
> index 89dd7166ca527bad..00d0d57172022138 100644
> --- a/src/v4l2/v4l2_camera_proxy.cpp
> +++ b/src/v4l2/v4l2_camera_proxy.cpp
> @@ -270,11 +270,11 @@ int V4L2CameraProxy::vidioc_s_fmt(struct v4l2_format *arg)
>  	tryFormat(arg);
>  
>  	Size size(arg->fmt.pix.width, arg->fmt.pix.height);
> -	ret = vcam_->invokeMethod(&V4L2Camera::configure,
> -				  ConnectionTypeBlocking,
> -				  &streamConfig_, size,
> -				  v4l2ToDrm(arg->fmt.pix.pixelformat),
> -				  bufferCount_);
> +	int ret = vcam_->invokeMethod(&V4L2Camera::configure,
> +				      ConnectionTypeBlocking,
> +				      &streamConfig_, size,
> +				      v4l2ToDrm(arg->fmt.pix.pixelformat),
> +				      bufferCount_);
>  	if (ret < 0)
>  		return -EINVAL;
>
Niklas Söderlund Jan. 8, 2020, 11:44 p.m. UTC | #3
Hi,

Pushed to master.

On 2020-01-09 00:15:18 +0100, Niklas Söderlund wrote:
> Refactoring of the camera_proxy have left the 'ret' variable undeclared,
> declare it.
> 
> ../../src/v4l2/v4l2_camera_proxy.cpp:273:2: error: use of undeclared identifier 'ret'
>         ret = vcam_->invokeMethod(&V4L2Camera::configure,
>         ^
> ../../src/v4l2/v4l2_camera_proxy.cpp:278:6: error: use of undeclared identifier 'ret'
>         if (ret < 0)
> 
> Fixes: fce110c6d961c3bb ("v4l2: camera_proxy: Break out try_fmt")
> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
> ---
>  src/v4l2/v4l2_camera_proxy.cpp | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp
> index 89dd7166ca527bad..00d0d57172022138 100644
> --- a/src/v4l2/v4l2_camera_proxy.cpp
> +++ b/src/v4l2/v4l2_camera_proxy.cpp
> @@ -270,11 +270,11 @@ int V4L2CameraProxy::vidioc_s_fmt(struct v4l2_format *arg)
>  	tryFormat(arg);
>  
>  	Size size(arg->fmt.pix.width, arg->fmt.pix.height);
> -	ret = vcam_->invokeMethod(&V4L2Camera::configure,
> -				  ConnectionTypeBlocking,
> -				  &streamConfig_, size,
> -				  v4l2ToDrm(arg->fmt.pix.pixelformat),
> -				  bufferCount_);
> +	int ret = vcam_->invokeMethod(&V4L2Camera::configure,
> +				      ConnectionTypeBlocking,
> +				      &streamConfig_, size,
> +				      v4l2ToDrm(arg->fmt.pix.pixelformat),
> +				      bufferCount_);
>  	if (ret < 0)
>  		return -EINVAL;
>  
> -- 
> 2.24.1
>

Patch

diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp
index 89dd7166ca527bad..00d0d57172022138 100644
--- a/src/v4l2/v4l2_camera_proxy.cpp
+++ b/src/v4l2/v4l2_camera_proxy.cpp
@@ -270,11 +270,11 @@  int V4L2CameraProxy::vidioc_s_fmt(struct v4l2_format *arg)
 	tryFormat(arg);
 
 	Size size(arg->fmt.pix.width, arg->fmt.pix.height);
-	ret = vcam_->invokeMethod(&V4L2Camera::configure,
-				  ConnectionTypeBlocking,
-				  &streamConfig_, size,
-				  v4l2ToDrm(arg->fmt.pix.pixelformat),
-				  bufferCount_);
+	int ret = vcam_->invokeMethod(&V4L2Camera::configure,
+				      ConnectionTypeBlocking,
+				      &streamConfig_, size,
+				      v4l2ToDrm(arg->fmt.pix.pixelformat),
+				      bufferCount_);
 	if (ret < 0)
 		return -EINVAL;