[libcamera-devel,1/3] pipeline: raspberrypi: Add const qualifer in isRaw()
diff mbox series

Message ID 20211110100802.349623-1-naush@raspberrypi.com
State Superseded
Headers show
Series
  • [libcamera-devel,1/3] pipeline: raspberrypi: Add const qualifer in isRaw()
Related show

Commit Message

Naushir Patuck Nov. 10, 2021, 10:08 a.m. UTC
This function does not modify the pixFmt parameter, so use a const qualifier.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
---
 src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kieran Bingham Nov. 10, 2021, 10:16 a.m. UTC | #1
Quoting Naushir Patuck (2021-11-10 10:08:00)
> This function does not modify the pixFmt parameter, so use a const qualifier.
> 
> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>

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

> ---
>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> index 5e1f227398a9..11d3c2b120dd 100644
> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> @@ -96,7 +96,7 @@ V4L2DeviceFormat toV4L2DeviceFormat(const V4L2SubdeviceFormat &format,
>         return deviceFormat;
>  }
>  
> -bool isRaw(PixelFormat &pixFmt)
> +bool isRaw(const PixelFormat &pixFmt)
>  {
>         /*
>          * The isRaw test might be redundant right now the pipeline handler only
> -- 
> 2.25.1
>
Umang Jain Nov. 10, 2021, 4:54 p.m. UTC | #2
Hi Naush,

Thank you for the patch

On 11/10/21 3:38 PM, Naushir Patuck wrote:
> This function does not modify the pixFmt parameter, so use a const qualifier.
>
> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>


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

> ---
>   src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> index 5e1f227398a9..11d3c2b120dd 100644
> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> @@ -96,7 +96,7 @@ V4L2DeviceFormat toV4L2DeviceFormat(const V4L2SubdeviceFormat &format,
>   	return deviceFormat;
>   }
>   
> -bool isRaw(PixelFormat &pixFmt)
> +bool isRaw(const PixelFormat &pixFmt)
>   {
>   	/*
>   	 * The isRaw test might be redundant right now the pipeline handler only
Laurent Pinchart Nov. 11, 2021, 2:03 p.m. UTC | #3
Hi Naush,

Thank you for the patch.

On Wed, Nov 10, 2021 at 10:08:00AM +0000, Naushir Patuck wrote:
> This function does not modify the pixFmt parameter, so use a const qualifier.
> 
> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
> ---
>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> index 5e1f227398a9..11d3c2b120dd 100644
> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> @@ -96,7 +96,7 @@ V4L2DeviceFormat toV4L2DeviceFormat(const V4L2SubdeviceFormat &format,
>  	return deviceFormat;
>  }
>  
> -bool isRaw(PixelFormat &pixFmt)
> +bool isRaw(const PixelFormat &pixFmt)

You could even pass the pixel format by value.

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

>  {
>  	/*
>  	 * The isRaw test might be redundant right now the pipeline handler only

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
index 5e1f227398a9..11d3c2b120dd 100644
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
@@ -96,7 +96,7 @@  V4L2DeviceFormat toV4L2DeviceFormat(const V4L2SubdeviceFormat &format,
 	return deviceFormat;
 }
 
-bool isRaw(PixelFormat &pixFmt)
+bool isRaw(const PixelFormat &pixFmt)
 {
 	/*
 	 * The isRaw test might be redundant right now the pipeline handler only