[libcamera-devel,15/15] v4l2: Convert to pragma once
diff mbox series

Message ID 20211123224015.3619282-16-kieran.bingham@ideasonboard.com
State Accepted
Delegated to: Kieran Bingham
Headers show
Series
  • Use pragma once
Related show

Commit Message

Kieran Bingham Nov. 23, 2021, 10:40 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.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 src/v4l2/v4l2_camera.h         | 5 +----
 src/v4l2/v4l2_camera_file.h    | 5 +----
 src/v4l2/v4l2_camera_proxy.h   | 5 +----
 src/v4l2/v4l2_compat_manager.h | 5 +----
 4 files changed, 4 insertions(+), 16 deletions(-)

Patch
diff mbox series

diff --git a/src/v4l2/v4l2_camera.h b/src/v4l2/v4l2_camera.h
index e81996f21168..94263b2f5db6 100644
--- a/src/v4l2/v4l2_camera.h
+++ b/src/v4l2/v4l2_camera.h
@@ -5,8 +5,7 @@ 
  * v4l2_camera.h - V4L2 compatibility camera
  */
 
-#ifndef __V4L2_CAMERA_H__
-#define __V4L2_CAMERA_H__
+#pragma once
 
 #include <deque>
 #include <mutex>
@@ -86,5 +85,3 @@  private:
 	std::condition_variable bufferCV_;
 	unsigned int bufferAvailableCount_;
 };
-
-#endif /* __V4L2_CAMERA_H__ */
diff --git a/src/v4l2/v4l2_camera_file.h b/src/v4l2/v4l2_camera_file.h
index 8f4670a0fa49..6c4cb5d89dbf 100644
--- a/src/v4l2/v4l2_camera_file.h
+++ b/src/v4l2/v4l2_camera_file.h
@@ -5,8 +5,7 @@ 
  * v4l2_camera_file.h - V4L2 compatibility camera file information
  */
 
-#ifndef __V4L2_CAMERA_FILE_H__
-#define __V4L2_CAMERA_FILE_H__
+#pragma once
 
 #include <linux/videodev2.h>
 
@@ -33,5 +32,3 @@  private:
 	int efd_;
 	enum v4l2_priority priority_;
 };
-
-#endif /* __V4L2_CAMERA_FILE_H__ */
diff --git a/src/v4l2/v4l2_camera_proxy.h b/src/v4l2/v4l2_camera_proxy.h
index 56a45bb76650..fccec241879d 100644
--- a/src/v4l2/v4l2_camera_proxy.h
+++ b/src/v4l2/v4l2_camera_proxy.h
@@ -5,8 +5,7 @@ 
  * v4l2_camera_proxy.h - Proxy to V4L2 compatibility camera
  */
 
-#ifndef __V4L2_CAMERA_PROXY_H__
-#define __V4L2_CAMERA_PROXY_H__
+#pragma once
 
 #include <linux/videodev2.h>
 #include <map>
@@ -100,5 +99,3 @@  private:
 	/* This mutex is to serialize access to the proxy. */
 	libcamera::Mutex proxyMutex_;
 };
-
-#endif /* __V4L2_CAMERA_PROXY_H__ */
diff --git a/src/v4l2/v4l2_compat_manager.h b/src/v4l2/v4l2_compat_manager.h
index b11698cc165f..f52069f7b62d 100644
--- a/src/v4l2/v4l2_compat_manager.h
+++ b/src/v4l2/v4l2_compat_manager.h
@@ -5,8 +5,7 @@ 
  * v4l2_compat_manager.h - V4L2 compatibility manager
  */
 
-#ifndef __V4L2_COMPAT_MANAGER_H__
-#define __V4L2_COMPAT_MANAGER_H__
+#pragma once
 
 #include <fcntl.h>
 #include <map>
@@ -68,5 +67,3 @@  private:
 	std::map<int, std::shared_ptr<V4L2CameraFile>> files_;
 	std::map<void *, V4L2CameraProxy *> mmaps_;
 };
-
-#endif /* __V4L2_COMPAT_MANAGER_H__ */