[PATCH v2 15/20] libcamera: libcamera: Remove unused includes
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Sat Aug 31 02:31:31 CEST 2024
Hi Milan,
Thank you for the patch.
On Fri, Aug 30, 2024 at 05:27:12PM +0200, Milan Zamazal wrote:
> The includes that are not used can be removed.
>
> Signed-off-by: Milan Zamazal <mzamazal at redhat.com>
> ---
> src/libcamera/base/event_dispatcher_poll.cpp | 1 -
> src/libcamera/camera.cpp | 2 --
> src/libcamera/controls.cpp | 1 -
> src/libcamera/converter/converter_v4l2_m2m.cpp | 1 -
> src/libcamera/formats.cpp | 3 ---
> src/libcamera/ipa_module.cpp | 1 -
> src/libcamera/ipa_proxy.cpp | 1 -
> src/libcamera/orientation.cpp | 1 -
> src/libcamera/pipeline_handler.cpp | 1 -
> src/libcamera/process.cpp | 1 -
> src/libcamera/sensor/camera_sensor.cpp | 2 --
> src/libcamera/shared_mem_object.cpp | 1 -
> src/libcamera/stream.cpp | 2 --
> 13 files changed, 18 deletions(-)
>
> diff --git a/src/libcamera/base/event_dispatcher_poll.cpp b/src/libcamera/base/event_dispatcher_poll.cpp
> index b737ca7a..86a26f36 100644
> --- a/src/libcamera/base/event_dispatcher_poll.cpp
> +++ b/src/libcamera/base/event_dispatcher_poll.cpp
> @@ -7,7 +7,6 @@
>
> #include <libcamera/base/event_dispatcher_poll.h>
>
> -#include <algorithm>
> #include <chrono>
I think chrono is also unneeded.
> #include <iomanip>
One of the very few places where iomanip is actually needed :-) I wonder
how we ended up including it in so many places.
> #include <poll.h>
vector should be added.
> diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp
> index 382a68f7..88210ff3 100644
> --- a/src/libcamera/camera.cpp
> +++ b/src/libcamera/camera.cpp
> @@ -9,7 +9,6 @@
>
> #include <array>
> #include <atomic>
> -#include <iomanip>
Missing ios, optional and sstream.
>
> #include <libcamera/base/log.h>
> #include <libcamera/base/thread.h>
> @@ -21,7 +20,6 @@
>
> #include "libcamera/internal/camera.h"
> #include "libcamera/internal/camera_controls.h"
> -#include "libcamera/internal/formats.h"
> #include "libcamera/internal/pipeline_handler.h"
> #include "libcamera/internal/request.h"
>
> diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp
> index 11d35321..67400797 100644
> --- a/src/libcamera/controls.cpp
> +++ b/src/libcamera/controls.cpp
> @@ -7,7 +7,6 @@
>
> #include <libcamera/controls.h>
>
> -#include <iomanip>
> #include <sstream>
> #include <string>
> #include <string.h>
> diff --git a/src/libcamera/converter/converter_v4l2_m2m.cpp b/src/libcamera/converter/converter_v4l2_m2m.cpp
> index 006ba9f7..e4f656da 100644
> --- a/src/libcamera/converter/converter_v4l2_m2m.cpp
> +++ b/src/libcamera/converter/converter_v4l2_m2m.cpp
> @@ -8,7 +8,6 @@
>
> #include "libcamera/internal/converter/converter_v4l2_m2m.h"
>
> -#include <algorithm>
> #include <limits.h>
>
> #include <libcamera/base/log.h>
> diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
> index 1d1d9a30..3ee89590 100644
> --- a/src/libcamera/formats.cpp
> +++ b/src/libcamera/formats.cpp
> @@ -7,9 +7,6 @@
>
> #include "libcamera/internal/formats.h"
>
> -#include <algorithm>
> -#include <errno.h>
> -
> #include <libcamera/base/log.h>
> #include <libcamera/base/utils.h>
>
> diff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp
> index 0756b691..86d88a86 100644
> --- a/src/libcamera/ipa_module.cpp
> +++ b/src/libcamera/ipa_module.cpp
> @@ -8,7 +8,6 @@
> #include "libcamera/internal/ipa_module.h"
>
> #include <algorithm>
> -#include <array>
> #include <ctype.h>
> #include <dlfcn.h>
> #include <elf.h>
> diff --git a/src/libcamera/ipa_proxy.cpp b/src/libcamera/ipa_proxy.cpp
> index 69975d8f..85004737 100644
> --- a/src/libcamera/ipa_proxy.cpp
> +++ b/src/libcamera/ipa_proxy.cpp
> @@ -7,7 +7,6 @@
>
> #include "libcamera/internal/ipa_proxy.h"
>
> -#include <string.h>
> #include <sys/stat.h>
> #include <sys/types.h>
> #include <unistd.h>
> diff --git a/src/libcamera/orientation.cpp b/src/libcamera/orientation.cpp
> index fd191197..bf960249 100644
> --- a/src/libcamera/orientation.cpp
> +++ b/src/libcamera/orientation.cpp
> @@ -8,7 +8,6 @@
> #include <libcamera/orientation.h>
>
> #include <array>
> -#include <string>
>
> /**
> * \file orientation.h
> diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
> index 1fc22d6a..a63d3503 100644
> --- a/src/libcamera/pipeline_handler.cpp
> +++ b/src/libcamera/pipeline_handler.cpp
> @@ -22,7 +22,6 @@
> #include "libcamera/internal/camera.h"
> #include "libcamera/internal/camera_manager.h"
> #include "libcamera/internal/device_enumerator.h"
> -#include "libcamera/internal/framebuffer.h"
> #include "libcamera/internal/media_device.h"
> #include "libcamera/internal/request.h"
> #include "libcamera/internal/tracepoints.h"
> diff --git a/src/libcamera/process.cpp b/src/libcamera/process.cpp
> index 86d27b2d..c0f4d49f 100644
> --- a/src/libcamera/process.cpp
> +++ b/src/libcamera/process.cpp
> @@ -10,7 +10,6 @@
> #include <algorithm>
> #include <dirent.h>
> #include <fcntl.h>
> -#include <iostream>
> #include <list>
> #include <signal.h>
> #include <string.h>
> diff --git a/src/libcamera/sensor/camera_sensor.cpp b/src/libcamera/sensor/camera_sensor.cpp
> index c6d7f801..1382081a 100644
> --- a/src/libcamera/sensor/camera_sensor.cpp
> +++ b/src/libcamera/sensor/camera_sensor.cpp
> @@ -10,7 +10,6 @@
>
> #include <algorithm>
> #include <float.h>
> -#include <iomanip>
> #include <limits.h>
> #include <math.h>
> #include <string.h>
> @@ -24,7 +23,6 @@
> #include "libcamera/internal/bayer_format.h"
> #include "libcamera/internal/camera_lens.h"
> #include "libcamera/internal/camera_sensor_properties.h"
> -#include "libcamera/internal/formats.h"
> #include "libcamera/internal/sysfs.h"
>
> /**
> diff --git a/src/libcamera/shared_mem_object.cpp b/src/libcamera/shared_mem_object.cpp
> index d4c7991a..65b53919 100644
> --- a/src/libcamera/shared_mem_object.cpp
> +++ b/src/libcamera/shared_mem_object.cpp
> @@ -10,7 +10,6 @@
>
> #include "libcamera/internal/shared_mem_object.h"
>
> -#include <stddef.h>
> #include <stdint.h>
> #include <sys/mman.h>
> #include <sys/types.h>
> diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp
> index 053cc4b8..e70688f6 100644
> --- a/src/libcamera/stream.cpp
> +++ b/src/libcamera/stream.cpp
> @@ -9,9 +9,7 @@
>
> #include <algorithm>
> #include <array>
> -#include <iomanip>
> #include <limits.h>
> -#include <sstream>
You should include ostream.
>
> #include <libcamera/request.h>
>
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list