[PATCH v7 05/18] libcamera: shared_mem_object: Rename SIZE constant to `size'

Milan Zamazal mzamazal at redhat.com
Thu Apr 4 10:46:42 CEST 2024


Signed-off-by: Milan Zamazal <mzamazal at redhat.com>
---
 include/libcamera/internal/shared_mem_object.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/libcamera/internal/shared_mem_object.h b/include/libcamera/internal/shared_mem_object.h
index 98636b44..8f2e7120 100644
--- a/include/libcamera/internal/shared_mem_object.h
+++ b/include/libcamera/internal/shared_mem_object.h
@@ -23,7 +23,7 @@ template<class T>
 class SharedMemObject
 {
 public:
-	static constexpr std::size_t SIZE = sizeof(T);
+	static constexpr std::size_t size = sizeof(T);
 
 	SharedMemObject()
 		: obj_(nullptr)
@@ -45,11 +45,11 @@ public:
 		if (!fd_.isValid())
 			return;
 
-		ret = ftruncate(fd_.get(), SIZE);
+		ret = ftruncate(fd_.get(), size);
 		if (ret < 0)
 			return;
 
-		mem = mmap(nullptr, SIZE, PROT_READ | PROT_WRITE, MAP_SHARED,
+		mem = mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED,
 			   fd_.get(), 0);
 		if (mem == MAP_FAILED)
 			return;
@@ -69,7 +69,7 @@ public:
 	{
 		if (obj_) {
 			obj_->~T();
-			munmap(obj_, SIZE);
+			munmap(obj_, size);
 		}
 	}
 
-- 
2.42.0



More information about the libcamera-devel mailing list