[RFC,v2,2/3] libcamera: device_enumerator_udev: Disable copy/move
diff mbox series

Message ID 20251208110035.248881-2-barnabas.pocze@ideasonboard.com
State Accepted
Headers show
Series
  • [RFC,v2,1/3] libcamera: device_enumerator_udev: Add `override`
Related show

Commit Message

Barnabás Pőcze Dec. 8, 2025, 11 a.m. UTC
The default implementations generated by the compiler are not appropriate.
So disable them.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 include/libcamera/internal/device_enumerator_udev.h | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Jacopo Mondi Dec. 11, 2025, noon UTC | #1
Hi Barnabás

On Mon, Dec 08, 2025 at 12:00:34PM +0100, Barnabás Pőcze wrote:
> The default implementations generated by the compiler are not appropriate.
> So disable them.
>
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> ---
>  include/libcamera/internal/device_enumerator_udev.h | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/include/libcamera/internal/device_enumerator_udev.h b/include/libcamera/internal/device_enumerator_udev.h
> index fb0005921a..c2f7154b6b 100644
> --- a/include/libcamera/internal/device_enumerator_udev.h
> +++ b/include/libcamera/internal/device_enumerator_udev.h

Same comment, probably the sysfs backend needs the same.

Anyway, this and the previous patch are good on their own
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

> @@ -14,6 +14,8 @@
>  #include <string>
>  #include <sys/types.h>
>
> +#include <libcamera/base/class.h>
> +
>  #include "libcamera/internal/device_enumerator.h"
>
>  struct udev;
> @@ -54,6 +56,8 @@ private:
>  		DependencyMap deps_;
>  	};
>
> +	LIBCAMERA_DISABLE_COPY_AND_MOVE(DeviceEnumeratorUdev)
> +
>  	int addUdevDevice(struct udev_device *dev);
>  	int populateMediaDevice(MediaDevice *media, DependencyMap *deps);
>  	std::string lookupDeviceNode(dev_t devnum);
> --
> 2.52.0
>

Patch
diff mbox series

diff --git a/include/libcamera/internal/device_enumerator_udev.h b/include/libcamera/internal/device_enumerator_udev.h
index fb0005921a..c2f7154b6b 100644
--- a/include/libcamera/internal/device_enumerator_udev.h
+++ b/include/libcamera/internal/device_enumerator_udev.h
@@ -14,6 +14,8 @@ 
 #include <string>
 #include <sys/types.h>
 
+#include <libcamera/base/class.h>
+
 #include "libcamera/internal/device_enumerator.h"
 
 struct udev;
@@ -54,6 +56,8 @@  private:
 		DependencyMap deps_;
 	};
 
+	LIBCAMERA_DISABLE_COPY_AND_MOVE(DeviceEnumeratorUdev)
+
 	int addUdevDevice(struct udev_device *dev);
 	int populateMediaDevice(MediaDevice *media, DependencyMap *deps);
 	std::string lookupDeviceNode(dev_t devnum);