{"id":21144,"url":"https://patchwork.libcamera.org/api/1.1/patches/21144/?format=json","web_url":"https://patchwork.libcamera.org/patch/21144/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20240902154212.1281257-16-mzamazal@redhat.com>","date":"2024-09-02T15:42:08","name":"[v3,15/18] libcamera: libcamera: Formatting improvements","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"abd300faf9e776fb6f97016c5fd6ba3117cf7c15","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/1.1/people/177/?format=json","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/21144/mbox/","series":[{"id":4556,"url":"https://patchwork.libcamera.org/api/1.1/series/4556/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4556","date":"2024-09-02T15:41:53","name":"Remove unused includes","version":3,"mbox":"https://patchwork.libcamera.org/series/4556/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/21144/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/21144/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 6E815BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  2 Sep 2024 15:43:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 21507634F9;\n\tMon,  2 Sep 2024 17:43:04 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 168AA634E4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  2 Sep 2024 17:43:02 +0200 (CEST)","from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com\n\t(ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63])\n\tby relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n\tcipher=TLS_AES_256_GCM_SHA384) id us-mta-15-UoR5pvUTMgGAyqCiEnCgAQ-1;\n\tMon, 02 Sep 2024 11:42:59 -0400","from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com\n\t(mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com\n\t[10.30.177.15])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (2048 bits)\n\tserver-digest SHA256) (No client certificate requested)\n\tby mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTPS id 01C5B18EA8BA; Mon,  2 Sep 2024 15:42:59 +0000 (UTC)","from nuthatch.redhat.com (unknown [10.45.224.69])\n\tby mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTP id 914FC1955DD6; Mon,  2 Sep 2024 15:42:57 +0000 (UTC)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"MF7BEIml\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1725291781;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=wNtVImREKGcr23HHJ11YkNGo80gTdwO7i1iL4fRPoeQ=;\n\tb=MF7BEImlY+bfjfooRl4HUBnvrEWiRn6dU17bHk6N50B83LMY9EyFoJQ8yumvPW0ZjMdomG\n\tUXTJAxT6h6epLekttn2kniX9V5SZoAD+kE9FZiGCuPYOBI5wUFim7qXgrwF50axRtx+dKu\n\tmCc5JCuMMKFKglD9lu75Z4LW7CGXiTY=","X-MC-Unique":"UoR5pvUTMgGAyqCiEnCgAQ-1","From":"Milan Zamazal <mzamazal@redhat.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Milan Zamazal <mzamazal@redhat.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","Subject":"[PATCH v3 15/18] libcamera: libcamera: Formatting improvements","Date":"Mon,  2 Sep 2024 17:42:08 +0200","Message-ID":"<20240902154212.1281257-16-mzamazal@redhat.com>","In-Reply-To":"<20240902154212.1281257-1-mzamazal@redhat.com>","References":"<20240902154212.1281257-1-mzamazal@redhat.com>","MIME-Version":"1.0","X-Scanned-By":"MIMEDefang 3.0 on 10.30.177.15","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Transfer-Encoding":"8bit","Content-Type":"text/plain; charset=\"US-ASCII\"; x-default=true","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The LSP autoformatter doesn't like some of the current formatting, let's\nmake it happier.  Note that not all of its suggestions were accepted\nbecause readability is preferred and adjusting .clang-format may not be\neasy or possible.\n\nSigned-off-by: Milan Zamazal <mzamazal@redhat.com>\n---\n src/libcamera/controls.cpp             |  2 +-\n src/libcamera/ipa_data_serializer.cpp  |  3 +--\n src/libcamera/ipa_module.cpp           |  4 ++--\n src/libcamera/orientation.cpp          | 12 ++++++++----\n src/libcamera/process.cpp              |  5 ++---\n src/libcamera/sensor/camera_sensor.cpp |  6 +++---\n src/libcamera/shared_mem_object.cpp    |  4 ++--\n src/libcamera/stream.cpp               |  1 +\n 8 files changed, 20 insertions(+), 17 deletions(-)","diff":"diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp\nindex 67400797..dba74404 100644\n--- a/src/libcamera/controls.cpp\n+++ b/src/libcamera/controls.cpp\n@@ -8,8 +8,8 @@\n #include <libcamera/controls.h>\n \n #include <sstream>\n-#include <string>\n #include <string.h>\n+#include <string>\n \n #include <libcamera/base/log.h>\n #include <libcamera/base/utils.h>\ndiff --git a/src/libcamera/ipa_data_serializer.cpp b/src/libcamera/ipa_data_serializer.cpp\nindex f6dd7e6f..2189a246 100644\n--- a/src/libcamera/ipa_data_serializer.cpp\n+++ b/src/libcamera/ipa_data_serializer.cpp\n@@ -539,7 +539,6 @@ IPADataSerializer<SharedFD>::serialize(const SharedFD &data,\n \tif (data.isValid())\n \t\tfdVec.push_back(data);\n \n-\n \treturn { dataVec, fdVec };\n }\n \n@@ -606,7 +605,7 @@ IPADataSerializer<FrameBuffer::Plane>::deserialize(std::vector<uint8_t>::const_i\n \tFrameBuffer::Plane ret;\n \n \tret.fd = IPADataSerializer<SharedFD>::deserialize(dataBegin, dataBegin + 4,\n-\t\t\t\t\t\t\t\tfdsBegin, fdsBegin + 1);\n+\t\t\t\t\t\t\t  fdsBegin, fdsBegin + 1);\n \tret.offset = readPOD<uint32_t>(dataBegin, 4, dataEnd);\n \tret.length = readPOD<uint32_t>(dataBegin, 8, dataEnd);\n \ndiff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp\nindex 86d88a86..9ca74be6 100644\n--- a/src/libcamera/ipa_module.cpp\n+++ b/src/libcamera/ipa_module.cpp\n@@ -50,8 +50,8 @@ typename std::remove_extent_t<T> *elfPointer(Span<const uint8_t> elf,\n \tif (size > elf.size() || size < objSize)\n \t\treturn nullptr;\n \n-\treturn reinterpret_cast<typename std::remove_extent_t<T> *>\n-\t\t(reinterpret_cast<const char *>(elf.data()) + offset);\n+\treturn reinterpret_cast<typename std::remove_extent_t<T> *>(\n+\t\treinterpret_cast<const char *>(elf.data()) + offset);\n }\n \n template<typename T>\ndiff --git a/src/libcamera/orientation.cpp b/src/libcamera/orientation.cpp\nindex bf960249..7d7d21ae 100644\n--- a/src/libcamera/orientation.cpp\n+++ b/src/libcamera/orientation.cpp\n@@ -101,10 +101,14 @@ std::ostream &operator<<(std::ostream &out, const Orientation &orientation)\n {\n \tconstexpr std::array<const char *, 9> orientationNames = {\n \t\t\"\", /* Orientation starts counting from 1. */\n-\t\t\"Rotate0\", \"Rotate0Mirror\",\n-\t\t\"Rotate180\", \"Rotate180Mirror\",\n-\t\t\"Rotate90Mirror\", \"Rotate270\",\n-\t\t\"Rotate270Mirror\", \"Rotate90\",\n+\t\t\"Rotate0\",\n+\t\t\"Rotate0Mirror\",\n+\t\t\"Rotate180\",\n+\t\t\"Rotate180Mirror\",\n+\t\t\"Rotate90Mirror\",\n+\t\t\"Rotate270\",\n+\t\t\"Rotate270Mirror\",\n+\t\t\"Rotate90\",\n \t};\n \n \tout << orientationNames[static_cast<unsigned int>(orientation)];\ndiff --git a/src/libcamera/process.cpp b/src/libcamera/process.cpp\nindex c0f4d49f..bc9833f4 100644\n--- a/src/libcamera/process.cpp\n+++ b/src/libcamera/process.cpp\n@@ -188,7 +188,6 @@ const struct sigaction &ProcessManager::oldsa() const\n \treturn oldsa_;\n }\n \n-\n /**\n  * \\class Process\n  * \\brief Process object\n@@ -270,8 +269,8 @@ int Process::start(const std::string &path,\n \t\tunsigned int len = args.size();\n \t\targv[0] = path.c_str();\n \t\tfor (unsigned int i = 0; i < len; i++)\n-\t\t\targv[i+1] = args[i].c_str();\n-\t\targv[len+1] = nullptr;\n+\t\t\targv[i + 1] = args[i].c_str();\n+\t\targv[len + 1] = nullptr;\n \n \t\texecv(path.c_str(), (char **)argv);\n \ndiff --git a/src/libcamera/sensor/camera_sensor.cpp b/src/libcamera/sensor/camera_sensor.cpp\nindex 1382081a..4a990bb9 100644\n--- a/src/libcamera/sensor/camera_sensor.cpp\n+++ b/src/libcamera/sensor/camera_sensor.cpp\n@@ -6,7 +6,6 @@\n  */\n \n #include \"libcamera/internal/camera_sensor.h\"\n-#include \"libcamera/internal/media_device.h\"\n \n #include <algorithm>\n #include <float.h>\n@@ -14,15 +13,16 @@\n #include <math.h>\n #include <string.h>\n \n+#include <libcamera/base/utils.h>\n+\n #include <libcamera/camera.h>\n #include <libcamera/orientation.h>\n #include <libcamera/property_ids.h>\n \n-#include <libcamera/base/utils.h>\n-\n #include \"libcamera/internal/bayer_format.h\"\n #include \"libcamera/internal/camera_lens.h\"\n #include \"libcamera/internal/camera_sensor_properties.h\"\n+#include \"libcamera/internal/media_device.h\"\n #include \"libcamera/internal/sysfs.h\"\n \n /**\ndiff --git a/src/libcamera/shared_mem_object.cpp b/src/libcamera/shared_mem_object.cpp\nindex 65b53919..d9b61d37 100644\n--- a/src/libcamera/shared_mem_object.cpp\n+++ b/src/libcamera/shared_mem_object.cpp\n@@ -57,8 +57,8 @@ SharedMem::SharedMem() = default;\n  */\n SharedMem::SharedMem(const std::string &name, std::size_t size)\n {\n-\tUniqueFD memfd = MemFd::create(name.c_str(), size, MemFd::Seal::Shrink |\n-\t\t\t\t       MemFd::Seal::Grow);\n+\tUniqueFD memfd = MemFd::create(name.c_str(), size,\n+\t\t\t\t       MemFd::Seal::Shrink | MemFd::Seal::Grow);\n \tif (!memfd.isValid())\n \t\treturn;\n \ndiff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp\nindex 33018ec1..a254d2f6 100644\n--- a/src/libcamera/stream.cpp\n+++ b/src/libcamera/stream.cpp\n@@ -19,6 +19,7 @@\n #include <libcamera/base/log.h>\n #include <libcamera/base/utils.h>\n \n+#include <libcamera/request.h>\n \n /**\n  * \\file stream.h\n","prefixes":["v3","15/18"]}