[libcamera-devel] [PATCH 09/15] ipa: ipu3: Convert to pragma once

Kieran Bingham kieran.bingham at ideasonboard.com
Tue Nov 23 23:40:09 CET 2021


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.

Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
---
 src/ipa/ipu3/algorithms/agc.h          | 6 ++----
 src/ipa/ipu3/algorithms/algorithm.h    | 6 ++----
 src/ipa/ipu3/algorithms/awb.h          | 5 ++---
 src/ipa/ipu3/algorithms/blc.h          | 6 ++----
 src/ipa/ipu3/algorithms/tone_mapping.h | 6 ++----
 src/ipa/ipu3/ipa_context.h             | 6 ++----
 6 files changed, 12 insertions(+), 23 deletions(-)

diff --git a/src/ipa/ipu3/algorithms/agc.h b/src/ipa/ipu3/algorithms/agc.h
index a04a81fb8eae..96ec7005acb6 100644
--- a/src/ipa/ipu3/algorithms/agc.h
+++ b/src/ipa/ipu3/algorithms/agc.h
@@ -4,8 +4,8 @@
  *
  * agc.h - IPU3 AGC/AEC mean-based control algorithm
  */
-#ifndef __LIBCAMERA_IPU3_ALGORITHMS_AGC_H__
-#define __LIBCAMERA_IPU3_ALGORITHMS_AGC_H__
+
+#pragma once
 
 #include <linux/intel-ipu3.h>
 
@@ -59,5 +59,3 @@ private:
 } /* namespace ipa::ipu3::algorithms */
 
 } /* namespace libcamera */
-
-#endif /* __LIBCAMERA_IPU3_ALGORITHMS_AGC_H__ */
diff --git a/src/ipa/ipu3/algorithms/algorithm.h b/src/ipa/ipu3/algorithms/algorithm.h
index 43f5d8b058b5..16310ab16985 100644
--- a/src/ipa/ipu3/algorithms/algorithm.h
+++ b/src/ipa/ipu3/algorithms/algorithm.h
@@ -4,8 +4,8 @@
  *
  * algorithm.h - IPU3 control algorithm interface
  */
-#ifndef __LIBCAMERA_IPA_IPU3_ALGORITHM_H__
-#define __LIBCAMERA_IPA_IPU3_ALGORITHM_H__
+
+#pragma once
 
 #include <libcamera/ipa/ipu3_ipa_interface.h>
 
@@ -28,5 +28,3 @@ public:
 } /* namespace ipa::ipu3 */
 
 } /* namespace libcamera */
-
-#endif /* __LIBCAMERA_IPA_IPU3_ALGORITHM_H__ */
diff --git a/src/ipa/ipu3/algorithms/awb.h b/src/ipa/ipu3/algorithms/awb.h
index b90782c1cb5c..ab4b0a338369 100644
--- a/src/ipa/ipu3/algorithms/awb.h
+++ b/src/ipa/ipu3/algorithms/awb.h
@@ -4,8 +4,8 @@
  *
  * awb.h - IPU3 AWB control algorithm
  */
-#ifndef __LIBCAMERA_IPU3_ALGORITHMS_AWB_H__
-#define __LIBCAMERA_IPU3_ALGORITHMS_AWB_H__
+
+#pragma once
 
 #include <vector>
 
@@ -86,4 +86,3 @@ private:
 } /* namespace ipa::ipu3::algorithms */
 
 } /* namespace libcamera*/
-#endif /* __LIBCAMERA_IPU3_ALGORITHMS_AWB_H__ */
diff --git a/src/ipa/ipu3/algorithms/blc.h b/src/ipa/ipu3/algorithms/blc.h
index 4b7cb483fae6..d8da1748baba 100644
--- a/src/ipa/ipu3/algorithms/blc.h
+++ b/src/ipa/ipu3/algorithms/blc.h
@@ -4,8 +4,8 @@
  *
  * black_correction.h - IPU3 Black Level Correction control
  */
-#ifndef __LIBCAMERA_IPU3_ALGORITHMS_BLC_H__
-#define __LIBCAMERA_IPU3_ALGORITHMS_BLC_H__
+
+#pragma once
 
 #include "algorithm.h"
 
@@ -24,5 +24,3 @@ public:
 } /* namespace ipa::ipu3::algorithms */
 
 } /* namespace libcamera */
-
-#endif /* __LIBCAMERA_IPU3_ALGORITHMS_BLC_H__ */
diff --git a/src/ipa/ipu3/algorithms/tone_mapping.h b/src/ipa/ipu3/algorithms/tone_mapping.h
index 46dd6171b1d5..b727ab1e25a6 100644
--- a/src/ipa/ipu3/algorithms/tone_mapping.h
+++ b/src/ipa/ipu3/algorithms/tone_mapping.h
@@ -4,8 +4,8 @@
  *
  * tone_mapping.h - IPU3 ToneMapping and Gamma control
  */
-#ifndef __LIBCAMERA_IPU3_ALGORITHMS_TONE_MAPPING_H__
-#define __LIBCAMERA_IPU3_ALGORITHMS_TONE_MAPPING_H__
+
+#pragma once
 
 #include "algorithm.h"
 
@@ -29,5 +29,3 @@ private:
 } /* namespace ipa::ipu3::algorithms */
 
 } /* namespace libcamera */
-
-#endif /* __LIBCAMERA_IPU3_ALGORITHMS_TONE_MAPPING_H__ */
diff --git a/src/ipa/ipu3/ipa_context.h b/src/ipa/ipu3/ipa_context.h
index fd97e240f3fa..c6dc08147321 100644
--- a/src/ipa/ipu3/ipa_context.h
+++ b/src/ipa/ipu3/ipa_context.h
@@ -5,8 +5,8 @@
  * ipa_context.h - IPU3 IPA Context
  *
  */
-#ifndef __LIBCAMERA_IPU3_IPA_CONTEXT_H__
-#define __LIBCAMERA_IPU3_IPA_CONTEXT_H__
+
+#pragma once
 
 #include <linux/intel-ipu3.h>
 
@@ -68,5 +68,3 @@ struct IPAContext {
 } /* namespace ipa::ipu3 */
 
 } /* namespace libcamera*/
-
-#endif /* __LIBCAMERA_IPU3_IPA_CONTEXT_H__ */
-- 
2.30.2



More information about the libcamera-devel mailing list