[libcamera-devel,v3,1/5] libcamera: internal: request: convert to pragma once
diff mbox series

Message ID 20230515124550.3601128-2-kieran.bingham@ideasonboard.com
State Accepted
Headers show
Series
  • libcamera: Add new Camera devices property
Related show

Commit Message

Kieran Bingham May 15, 2023, 12:45 p.m. UTC
Remove the verbose #ifndef/#define/#endif pattern for maintaining
header idempotency, and replace it with a simple #pragma once.

This simplifies the headers, and prevents redundant changes when
header files get moved.

The internal/request.h was missed at the time of the original
conversion. Update it.

Fixes: df131ad08893 ("libcamera: internal: Convert to pragma once")
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 include/libcamera/internal/request.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Ashok Sidipotu June 6, 2023, 11:53 a.m. UTC | #1
Tested-by: Ashok Sidipotu <ashok.sidipotu@collabora.com>
On Monday, May 15, 2023 18:15 IST, Kieran Bingham <kieran.bingham@ideasonboard.com> wrote:
 Remove the verbose #ifndef/#define/#endif pattern for maintaining
header idempotency, and replace it with a simple #pragma once.

This simplifies the headers, and prevents redundant changes when
header files get moved.

The internal/request.h was missed at the time of the original
conversion. Update it.

Fixes: df131ad08893 ("libcamera: internal: Convert to pragma once")
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
include/libcamera/internal/request.h | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/include/libcamera/internal/request.h b/include/libcamera/internal/request.h
index 8c92a27a95e5..3454cf5a72f5 100644
--- a/include/libcamera/internal/request.h
+++ b/include/libcamera/internal/request.h
@@ -4,8 +4,8 @@
*
* request.h - Request class private data
*/
-#ifndef __LIBCAMERA_INTERNAL_REQUEST_H__
-#define __LIBCAMERA_INTERNAL_REQUEST_H__
+
+#pragma once

#include <chrono>
#include <map>
@@ -62,5 +62,3 @@ private:
};

} /* namespace libcamera */
-
-#endif /* __LIBCAMERA_INTERNAL_REQUEST_H__ */
--
2.34.1
Laurent Pinchart June 6, 2023, 3:56 p.m. UTC | #2
Hi Kieran,

Thank you for the patch.

On Mon, May 15, 2023 at 01:45:46PM +0100, Kieran Bingham via libcamera-devel wrote:
> Remove the verbose #ifndef/#define/#endif pattern for maintaining
> header idempotency, and replace it with a simple #pragma once.
> 
> This simplifies the headers, and prevents redundant changes when
> header files get moved.
> 
> The internal/request.h was missed at the time of the original
> conversion. Update it.
> 
> Fixes: df131ad08893 ("libcamera: internal: Convert to pragma once")
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

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

> ---
>  include/libcamera/internal/request.h | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/include/libcamera/internal/request.h b/include/libcamera/internal/request.h
> index 8c92a27a95e5..3454cf5a72f5 100644
> --- a/include/libcamera/internal/request.h
> +++ b/include/libcamera/internal/request.h
> @@ -4,8 +4,8 @@
>   *
>   * request.h - Request class private data
>   */
> -#ifndef __LIBCAMERA_INTERNAL_REQUEST_H__
> -#define __LIBCAMERA_INTERNAL_REQUEST_H__
> +
> +#pragma once
>  
>  #include <chrono>
>  #include <map>
> @@ -62,5 +62,3 @@ private:
>  };
>  
>  } /* namespace libcamera */
> -
> -#endif /* __LIBCAMERA_INTERNAL_REQUEST_H__ */
Jacopo Mondi June 15, 2023, 11:33 a.m. UTC | #3
Hi Kieran

On Mon, May 15, 2023 at 01:45:46PM +0100, Kieran Bingham via libcamera-devel wrote:
> Remove the verbose #ifndef/#define/#endif pattern for maintaining
> header idempotency, and replace it with a simple #pragma once.
>
> This simplifies the headers, and prevents redundant changes when
> header files get moved.
>
> The internal/request.h was missed at the time of the original
> conversion. Update it.
>
> Fixes: df131ad08893 ("libcamera: internal: Convert to pragma once")
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

> ---
>  include/libcamera/internal/request.h | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/include/libcamera/internal/request.h b/include/libcamera/internal/request.h
> index 8c92a27a95e5..3454cf5a72f5 100644
> --- a/include/libcamera/internal/request.h
> +++ b/include/libcamera/internal/request.h
> @@ -4,8 +4,8 @@
>   *
>   * request.h - Request class private data
>   */
> -#ifndef __LIBCAMERA_INTERNAL_REQUEST_H__
> -#define __LIBCAMERA_INTERNAL_REQUEST_H__
> +
> +#pragma once
>
>  #include <chrono>
>  #include <map>
> @@ -62,5 +62,3 @@ private:
>  };
>
>  } /* namespace libcamera */
> -
> -#endif /* __LIBCAMERA_INTERNAL_REQUEST_H__ */
> --
> 2.34.1
>

Patch
diff mbox series

diff --git a/include/libcamera/internal/request.h b/include/libcamera/internal/request.h
index 8c92a27a95e5..3454cf5a72f5 100644
--- a/include/libcamera/internal/request.h
+++ b/include/libcamera/internal/request.h
@@ -4,8 +4,8 @@ 
  *
  * request.h - Request class private data
  */
-#ifndef __LIBCAMERA_INTERNAL_REQUEST_H__
-#define __LIBCAMERA_INTERNAL_REQUEST_H__
+
+#pragma once
 
 #include <chrono>
 #include <map>
@@ -62,5 +62,3 @@  private:
 };
 
 } /* namespace libcamera */
-
-#endif /* __LIBCAMERA_INTERNAL_REQUEST_H__ */