[libcamera-devel] [PATCH] android: Fix unused parameter warnings on Chrome OS

Laurent Pinchart laurent.pinchart at ideasonboard.com
Tue Jun 1 02:19:28 CEST 2021


On Tue, Jun 01, 2021 at 01:53:28AM +0300, Laurent Pinchart wrote:
> The Chrome OS-specific code has multiple function parameters that are
> not used. This results in compilation warnings. Fix them with
> [[maybe_unused]].
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> Change-Id: I4f05ace5c1781b2593e80532553b6a02e399fed6

Apologies for this.

> ---
>  src/android/cros/camera3_hal.cpp      | 2 +-
>  src/android/mm/cros_camera_buffer.cpp | 5 +++--
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/src/android/cros/camera3_hal.cpp b/src/android/cros/camera3_hal.cpp
> index d6fc1d0fca06..fb863b5f9aa9 100644
> --- a/src/android/cros/camera3_hal.cpp
> +++ b/src/android/cros/camera3_hal.cpp
> @@ -9,7 +9,7 @@
>  
>  #include "../camera_hal_manager.h"
>  
> -static void set_up(cros::CameraMojoChannelManagerToken *token)
> +static void set_up([[maybe_unused]] cros::CameraMojoChannelManagerToken *token)
>  {
>  }
>  
> diff --git a/src/android/mm/cros_camera_buffer.cpp b/src/android/mm/cros_camera_buffer.cpp
> index 1a4fd5d1dfe3..59e26d1b5972 100644
> --- a/src/android/mm/cros_camera_buffer.cpp
> +++ b/src/android/mm/cros_camera_buffer.cpp
> @@ -48,7 +48,8 @@ private:
>  };
>  
>  CameraBuffer::Private::Private(CameraBuffer *cameraBuffer,
> -			       buffer_handle_t camera3Buffer, int flags)
> +			       buffer_handle_t camera3Buffer,
> +			       [[maybe_unused]] int flags)
>  	: Extensible::Private(cameraBuffer), handle_(camera3Buffer),
>  	  numPlanes_(0), valid_(false), registered_(false)
>  {
> @@ -128,7 +129,7 @@ Span<uint8_t> CameraBuffer::Private::plane(unsigned int plane)
>  		 bufferManager_->GetPlaneSize(handle_, plane) };
>  }
>  
> -size_t CameraBuffer::Private::jpegBufferSize(size_t maxJpegBufferSize) const
> +size_t CameraBuffer::Private::jpegBufferSize([[maybe_unused]] size_t maxJpegBufferSize) const
>  {
>  	return bufferManager_->GetPlaneSize(handle_, 0);
>  }

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list