[{"id":21424,"web_url":"https://patchwork.libcamera.org/comment/21424/","msgid":"<20211130081000.cogakur4f52cphpe@uno.localdomain>","date":"2021-11-30T08:10:00","subject":"Re: [libcamera-devel] [PATCH v4 21/22] libcamera: base: shared_fd:\n\tRename fd() to get()","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent\n\nOn Tue, Nov 30, 2021 at 05:38:19AM +0200, Laurent Pinchart wrote:\n> For consistency with UniqueFD, rename the fd() function to get().\n> Renaming UniqueFD::get() to fd() would have been another option, but was\n> rejected to keep as close as possible to the std::shared_ptr<> and\n> std::unique_ptr<> APIs.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nI like this!\n\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\nThanks\n  j\n\n> ---\n>  include/libcamera/base/shared_fd.h            |  2 +-\n>  include/libcamera/internal/v4l2_videodevice.h |  2 +-\n>  src/cam/drm.cpp                               |  4 +-\n>  src/cam/image.cpp                             |  4 +-\n>  src/gstreamer/gstlibcameraallocator.cpp       |  2 +-\n>  src/ipa/raspberrypi/raspberrypi.cpp           |  2 +-\n>  src/libcamera/base/shared_fd.cpp              |  4 +-\n>  src/libcamera/framebuffer.cpp                 |  2 +-\n>  src/libcamera/ipc_pipe.cpp                    |  2 +-\n>  src/libcamera/mapped_framebuffer.cpp          |  4 +-\n>  .../pipeline/raspberrypi/raspberrypi.cpp      |  2 +-\n>  src/libcamera/v4l2_videodevice.cpp            |  6 +--\n>  src/v4l2/v4l2_camera.cpp                      |  2 +-\n>  test/shared-fd.cpp                            | 39 ++++++++++---------\n>  14 files changed, 39 insertions(+), 38 deletions(-)\n>\n> diff --git a/include/libcamera/base/shared_fd.h b/include/libcamera/base/shared_fd.h\n> index 1dd51a7f046b..e53a8b88601e 100644\n> --- a/include/libcamera/base/shared_fd.h\n> +++ b/include/libcamera/base/shared_fd.h\n> @@ -27,7 +27,7 @@ public:\n>  \tSharedFD &operator=(SharedFD &&other);\n>\n>  \tbool isValid() const { return fd_ != nullptr; }\n> -\tint fd() const { return fd_ ? fd_->fd() : -1; }\n> +\tint get() const { return fd_ ? fd_->fd() : -1; }\n>  \tUniqueFD dup() const;\n>\n>  private:\n> diff --git a/include/libcamera/internal/v4l2_videodevice.h b/include/libcamera/internal/v4l2_videodevice.h\n> index 5ba2b54643ac..9b2ec3afecff 100644\n> --- a/include/libcamera/internal/v4l2_videodevice.h\n> +++ b/include/libcamera/internal/v4l2_videodevice.h\n> @@ -140,7 +140,7 @@ private:\n>  \tprivate:\n>  \t\tstruct Plane {\n>  \t\t\tPlane(const FrameBuffer::Plane &plane)\n> -\t\t\t\t: fd(plane.fd.fd()), length(plane.length)\n> +\t\t\t\t: fd(plane.fd.get()), length(plane.length)\n>  \t\t\t{\n>  \t\t\t}\n>\n> diff --git a/src/cam/drm.cpp b/src/cam/drm.cpp\n> index f25300913a7f..46e34eb546fb 100644\n> --- a/src/cam/drm.cpp\n> +++ b/src/cam/drm.cpp\n> @@ -608,12 +608,12 @@ std::unique_ptr<FrameBuffer> Device::createFrameBuffer(\n>\n>  \tunsigned int i = 0;\n>  \tfor (const libcamera::FrameBuffer::Plane &plane : planes) {\n> -\t\tint fd = plane.fd.fd();\n> +\t\tint fd = plane.fd.get();\n>  \t\tuint32_t handle;\n>\n>  \t\tauto iter = fb->planes_.find(fd);\n>  \t\tif (iter == fb->planes_.end()) {\n> -\t\t\tret = drmPrimeFDToHandle(fd_, plane.fd.fd(), &handle);\n> +\t\t\tret = drmPrimeFDToHandle(fd_, plane.fd.get(), &handle);\n>  \t\t\tif (ret < 0) {\n>  \t\t\t\tret = -errno;\n>  \t\t\t\tstd::cerr\n> diff --git a/src/cam/image.cpp b/src/cam/image.cpp\n> index 0180be78d396..fe2cc6da5a15 100644\n> --- a/src/cam/image.cpp\n> +++ b/src/cam/image.cpp\n> @@ -39,7 +39,7 @@ std::unique_ptr<Image> Image::fromFrameBuffer(const FrameBuffer *buffer, MapMode\n>  \tstd::map<int, MappedBufferInfo> mappedBuffers;\n>\n>  \tfor (const FrameBuffer::Plane &plane : buffer->planes()) {\n> -\t\tconst int fd = plane.fd.fd();\n> +\t\tconst int fd = plane.fd.get();\n>  \t\tif (mappedBuffers.find(fd) == mappedBuffers.end()) {\n>  \t\t\tconst size_t length = lseek(fd, 0, SEEK_END);\n>  \t\t\tmappedBuffers[fd] = MappedBufferInfo{ nullptr, 0, length };\n> @@ -61,7 +61,7 @@ std::unique_ptr<Image> Image::fromFrameBuffer(const FrameBuffer *buffer, MapMode\n>  \t}\n>\n>  \tfor (const FrameBuffer::Plane &plane : buffer->planes()) {\n> -\t\tconst int fd = plane.fd.fd();\n> +\t\tconst int fd = plane.fd.get();\n>  \t\tauto &info = mappedBuffers[fd];\n>  \t\tif (!info.address) {\n>  \t\t\tvoid *address = mmap(nullptr, info.mapLength, mmapFlags,\n> diff --git a/src/gstreamer/gstlibcameraallocator.cpp b/src/gstreamer/gstlibcameraallocator.cpp\n> index cb07d6e9e87f..c740b8fc82a8 100644\n> --- a/src/gstreamer/gstlibcameraallocator.cpp\n> +++ b/src/gstreamer/gstlibcameraallocator.cpp\n> @@ -52,7 +52,7 @@ FrameWrap::FrameWrap(GstAllocator *allocator, FrameBuffer *buffer,\n>  \t  outstandingPlanes_(0)\n>  {\n>  \tfor (const FrameBuffer::Plane &plane : buffer->planes()) {\n> -\t\tGstMemory *mem = gst_fd_allocator_alloc(allocator, plane.fd.fd(),\n> +\t\tGstMemory *mem = gst_fd_allocator_alloc(allocator, plane.fd.get(),\n>  \t\t\t\t\t\t\tplane.offset + plane.length,\n>  \t\t\t\t\t\t\tGST_FD_MEMORY_FLAG_DONT_CLOSE);\n>  \t\tgst_memory_resize(mem, plane.offset, plane.length);\n> diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\n> index aaf629eeb3fc..0ed41385018a 100644\n> --- a/src/ipa/raspberrypi/raspberrypi.cpp\n> +++ b/src/ipa/raspberrypi/raspberrypi.cpp\n> @@ -377,7 +377,7 @@ int IPARPi::configure(const IPACameraSensorInfo &sensorInfo,\n>  \t\tlsTableHandle_ = std::move(ipaConfig.lsTableHandle);\n>  \t\tif (lsTableHandle_.isValid()) {\n>  \t\t\tlsTable_ = mmap(nullptr, ipa::RPi::MaxLsGridSize, PROT_READ | PROT_WRITE,\n> -\t\t\t\t\tMAP_SHARED, lsTableHandle_.fd(), 0);\n> +\t\t\t\t\tMAP_SHARED, lsTableHandle_.get(), 0);\n>\n>  \t\t\tif (lsTable_ == MAP_FAILED) {\n>  \t\t\t\tLOG(IPARPI, Error) << \"dmaHeap mmap failure for LS table.\";\n> diff --git a/src/libcamera/base/shared_fd.cpp b/src/libcamera/base/shared_fd.cpp\n> index 56dc579258c7..0c8b93a47f85 100644\n> --- a/src/libcamera/base/shared_fd.cpp\n> +++ b/src/libcamera/base/shared_fd.cpp\n> @@ -208,7 +208,7 @@ SharedFD &SharedFD::operator=(SharedFD &&other)\n>   */\n>\n>  /**\n> - * \\fn SharedFD::fd()\n> + * \\fn SharedFD::get()\n>   * \\brief Retrieve the numerical file descriptor\n>   * \\return The numerical file descriptor, which may be -1 if the SharedFD\n>   * instance is invalid\n> @@ -253,7 +253,7 @@ SharedFD &SharedFD::operator=(SharedFD &&other)\n>   */\n>  UniqueFD SharedFD::dup() const\n>  {\n> -\tint dupFd = ::dup(fd());\n> +\tint dupFd = ::dup(get());\n>  \tif (dupFd == -1) {\n>  \t\tint ret = -errno;\n>  \t\tLOG(SharedFD, Error)\n> diff --git a/src/libcamera/framebuffer.cpp b/src/libcamera/framebuffer.cpp\n> index f313566c5561..701212f3ae21 100644\n> --- a/src/libcamera/framebuffer.cpp\n> +++ b/src/libcamera/framebuffer.cpp\n> @@ -218,7 +218,7 @@ ino_t fileDescriptorInode(const SharedFD &fd)\n>  \t\treturn 0;\n>\n>  \tstruct stat st;\n> -\tint ret = fstat(fd.fd(), &st);\n> +\tint ret = fstat(fd.get(), &st);\n>  \tif (ret < 0) {\n>  \t\tret = -errno;\n>  \t\tLOG(Buffer, Fatal)\n> diff --git a/src/libcamera/ipc_pipe.cpp b/src/libcamera/ipc_pipe.cpp\n> index 3b47032de0a2..31a0ca09f9f0 100644\n> --- a/src/libcamera/ipc_pipe.cpp\n> +++ b/src/libcamera/ipc_pipe.cpp\n> @@ -113,7 +113,7 @@ IPCUnixSocket::Payload IPCMessage::payload() const\n>  \t}\n>\n>  \tfor (const SharedFD &fd : fds_)\n> -\t\tpayload.fds.push_back(fd.fd());\n> +\t\tpayload.fds.push_back(fd.get());\n>\n>  \treturn payload;\n>  }\n> diff --git a/src/libcamera/mapped_framebuffer.cpp b/src/libcamera/mapped_framebuffer.cpp\n> index 464d35fef2d2..6860069b68ca 100644\n> --- a/src/libcamera/mapped_framebuffer.cpp\n> +++ b/src/libcamera/mapped_framebuffer.cpp\n> @@ -198,7 +198,7 @@ MappedFrameBuffer::MappedFrameBuffer(const FrameBuffer *buffer, MapFlags flags)\n>  \tstd::map<int, MappedBufferInfo> mappedBuffers;\n>\n>  \tfor (const FrameBuffer::Plane &plane : buffer->planes()) {\n> -\t\tconst int fd = plane.fd.fd();\n> +\t\tconst int fd = plane.fd.get();\n>  \t\tif (mappedBuffers.find(fd) == mappedBuffers.end()) {\n>  \t\t\tconst size_t length = lseek(fd, 0, SEEK_END);\n>  \t\t\tmappedBuffers[fd] = MappedBufferInfo{ nullptr, 0, length };\n> @@ -220,7 +220,7 @@ MappedFrameBuffer::MappedFrameBuffer(const FrameBuffer *buffer, MapFlags flags)\n>  \t}\n>\n>  \tfor (const FrameBuffer::Plane &plane : buffer->planes()) {\n> -\t\tconst int fd = plane.fd.fd();\n> +\t\tconst int fd = plane.fd.get();\n>  \t\tauto &info = mappedBuffers[fd];\n>  \t\tif (!info.address) {\n>  \t\t\tvoid *address = mmap(nullptr, info.mapLength, mmapFlags,\n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index fdcd1eca11d6..fa2848533b29 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -1470,7 +1470,7 @@ void RPiCameraData::setIspControls(const ControlList &controls)\n>  \t\tSpan<uint8_t> s = value.data();\n>  \t\tbcm2835_isp_lens_shading *ls =\n>  \t\t\treinterpret_cast<bcm2835_isp_lens_shading *>(s.data());\n> -\t\tls->dmabuf = lsTable_.fd();\n> +\t\tls->dmabuf = lsTable_.get();\n>  \t}\n>\n>  \tisp_[Isp::Input].dev()->setControls(&ctrls);\n> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n> index 0d214d9edc7a..b4b89e2759b9 100644\n> --- a/src/libcamera/v4l2_videodevice.cpp\n> +++ b/src/libcamera/v4l2_videodevice.cpp\n> @@ -282,7 +282,7 @@ bool V4L2BufferCache::Entry::operator==(const FrameBuffer &buffer) const\n>  \t\treturn false;\n>\n>  \tfor (unsigned int i = 0; i < planes.size(); i++)\n> -\t\tif (planes_[i].fd != planes[i].fd.fd() ||\n> +\t\tif (planes_[i].fd != planes[i].fd.get() ||\n>  \t\t    planes_[i].length != planes[i].length)\n>  \t\t\treturn false;\n>  \treturn true;\n> @@ -1517,9 +1517,9 @@ int V4L2VideoDevice::queueBuffer(FrameBuffer *buffer)\n>  \tif (buf.memory == V4L2_MEMORY_DMABUF) {\n>  \t\tif (multiPlanar) {\n>  \t\t\tfor (unsigned int p = 0; p < numV4l2Planes; ++p)\n> -\t\t\t\tv4l2Planes[p].m.fd = planes[p].fd.fd();\n> +\t\t\t\tv4l2Planes[p].m.fd = planes[p].fd.get();\n>  \t\t} else {\n> -\t\t\tbuf.m.fd = planes[0].fd.fd();\n> +\t\t\tbuf.m.fd = planes[0].fd.get();\n>  \t\t}\n>  \t}\n>\n> diff --git a/src/v4l2/v4l2_camera.cpp b/src/v4l2/v4l2_camera.cpp\n> index 464507505c79..e922b9e6aab2 100644\n> --- a/src/v4l2/v4l2_camera.cpp\n> +++ b/src/v4l2/v4l2_camera.cpp\n> @@ -195,7 +195,7 @@ int V4L2Camera::getBufferFd(unsigned int index)\n>  \tif (buffers.size() <= index)\n>  \t\treturn -1;\n>\n> -\treturn buffers[index]->planes()[0].fd.fd();\n> +\treturn buffers[index]->planes()[0].fd.get();\n>  }\n>\n>  int V4L2Camera::streamOn()\n> diff --git a/test/shared-fd.cpp b/test/shared-fd.cpp\n> index 60e5d0aaa395..997d7be18c47 100644\n> --- a/test/shared-fd.cpp\n> +++ b/test/shared-fd.cpp\n> @@ -46,7 +46,7 @@ protected:\n>  \t\t/* Test creating empty SharedFD. */\n>  \t\tdesc1_ = new SharedFD();\n>\n> -\t\tif (desc1_->fd() != -1) {\n> +\t\tif (desc1_->get() != -1) {\n>  \t\t\tstd::cout << \"Failed fd numerical check (default constructor)\"\n>  \t\t\t\t  << std::endl;\n>  \t\t\treturn TestFail;\n> @@ -60,19 +60,19 @@ protected:\n>  \t\t * descriptor.\n>  \t\t */\n>  \t\tdesc1_ = new SharedFD(fd_);\n> -\t\tif (desc1_->fd() == fd_) {\n> +\t\tif (desc1_->get() == fd_) {\n>  \t\t\tstd::cout << \"Failed fd numerical check (lvalue ref constructor)\"\n>  \t\t\t\t  << std::endl;\n>  \t\t\treturn TestFail;\n>  \t\t}\n>\n> -\t\tif (!isValidFd(fd_) || !isValidFd(desc1_->fd())) {\n> +\t\tif (!isValidFd(fd_) || !isValidFd(desc1_->get())) {\n>  \t\t\tstd::cout << \"Failed fd validity after construction (lvalue ref constructor)\"\n>  \t\t\t\t  << std::endl;\n>  \t\t\treturn TestFail;\n>  \t\t}\n>\n> -\t\tint fd = desc1_->fd();\n> +\t\tint fd = desc1_->get();\n>\n>  \t\tdelete desc1_;\n>  \t\tdesc1_ = nullptr;\n> @@ -91,19 +91,19 @@ protected:\n>  \t\tint dupFdCopy = dupFd;\n>\n>  \t\tdesc1_ = new SharedFD(std::move(dupFd));\n> -\t\tif (desc1_->fd() != dupFdCopy) {\n> +\t\tif (desc1_->get() != dupFdCopy) {\n>  \t\t\tstd::cout << \"Failed fd numerical check (rvalue ref constructor)\"\n>  \t\t\t\t  << std::endl;\n>  \t\t\treturn TestFail;\n>  \t\t}\n>\n> -\t\tif (dupFd != -1 || !isValidFd(fd_) || !isValidFd(desc1_->fd())) {\n> +\t\tif (dupFd != -1 || !isValidFd(fd_) || !isValidFd(desc1_->get())) {\n>  \t\t\tstd::cout << \"Failed fd validity after construction (rvalue ref constructor)\"\n>  \t\t\t\t  << std::endl;\n>  \t\t\treturn TestFail;\n>  \t\t}\n>\n> -\t\tfd = desc1_->fd();\n> +\t\tfd = desc1_->get();\n>\n>  \t\tdelete desc1_;\n>  \t\tdesc1_ = nullptr;\n> @@ -118,13 +118,14 @@ protected:\n>  \t\tdesc1_ = new SharedFD(fd_);\n>  \t\tdesc2_ = new SharedFD(*desc1_);\n>\n> -\t\tif (desc1_->fd() == fd_ || desc2_->fd() == fd_ || desc1_->fd() != desc2_->fd()) {\n> +\t\tif (desc1_->get() == fd_ || desc2_->get() == fd_ ||\n> +\t\t    desc1_->get() != desc2_->get()) {\n>  \t\t\tstd::cout << \"Failed fd numerical check (copy constructor)\"\n>  \t\t\t\t  << std::endl;\n>  \t\t\treturn TestFail;\n>  \t\t}\n>\n> -\t\tif (!isValidFd(desc1_->fd()) || !isValidFd(desc2_->fd())) {\n> +\t\tif (!isValidFd(desc1_->get()) || !isValidFd(desc2_->get())) {\n>  \t\t\tstd::cout << \"Failed fd validity after construction (copy constructor)\"\n>  \t\t\t\t  << std::endl;\n>  \t\t\treturn TestFail;\n> @@ -133,7 +134,7 @@ protected:\n>  \t\tdelete desc1_;\n>  \t\tdesc1_ = nullptr;\n>\n> -\t\tif (!isValidFd(desc2_->fd())) {\n> +\t\tif (!isValidFd(desc2_->get())) {\n>  \t\t\tstd::cout << \"Failed fd validity after destruction (copy constructor)\"\n>  \t\t\t\t  << std::endl;\n>  \t\t\treturn TestFail;\n> @@ -144,16 +145,16 @@ protected:\n>\n>  \t\t/* Test creating SharedFD by taking over other SharedFD. */\n>  \t\tdesc1_ = new SharedFD(fd_);\n> -\t\tfd = desc1_->fd();\n> +\t\tfd = desc1_->get();\n>  \t\tdesc2_ = new SharedFD(std::move(*desc1_));\n>\n> -\t\tif (desc1_->fd() != -1 || desc2_->fd() != fd) {\n> +\t\tif (desc1_->get() != -1 || desc2_->get() != fd) {\n>  \t\t\tstd::cout << \"Failed fd numerical check (move constructor)\"\n>  \t\t\t\t  << std::endl;\n>  \t\t\treturn TestFail;\n>  \t\t}\n>\n> -\t\tif (!isValidFd(desc2_->fd())) {\n> +\t\tif (!isValidFd(desc2_->get())) {\n>  \t\t\tstd::cout << \"Failed fd validity after construction (move constructor)\"\n>  \t\t\t\t  << std::endl;\n>  \t\t\treturn TestFail;\n> @@ -168,16 +169,16 @@ protected:\n>  \t\tdesc1_ = new SharedFD();\n>  \t\tdesc2_ = new SharedFD(fd_);\n>\n> -\t\tfd = desc2_->fd();\n> +\t\tfd = desc2_->get();\n>  \t\t*desc1_ = *desc2_;\n>\n> -\t\tif (desc1_->fd() != fd || desc2_->fd() != fd) {\n> +\t\tif (desc1_->get() != fd || desc2_->get() != fd) {\n>  \t\t\tstd::cout << \"Failed fd numerical check (copy assignment)\"\n>  \t\t\t\t  << std::endl;\n>  \t\t\treturn TestFail;\n>  \t\t}\n>\n> -\t\tif (!isValidFd(desc1_->fd()) || !isValidFd(desc2_->fd())) {\n> +\t\tif (!isValidFd(desc1_->get()) || !isValidFd(desc2_->get())) {\n>  \t\t\tstd::cout << \"Failed fd validity after construction (copy assignment)\"\n>  \t\t\t\t  << std::endl;\n>  \t\t\treturn TestFail;\n> @@ -192,16 +193,16 @@ protected:\n>  \t\tdesc1_ = new SharedFD();\n>  \t\tdesc2_ = new SharedFD(fd_);\n>\n> -\t\tfd = desc2_->fd();\n> +\t\tfd = desc2_->get();\n>  \t\t*desc1_ = std::move(*desc2_);\n>\n> -\t\tif (desc1_->fd() != fd || desc2_->fd() != -1) {\n> +\t\tif (desc1_->get() != fd || desc2_->get() != -1) {\n>  \t\t\tstd::cout << \"Failed fd numerical check (move assignment)\"\n>  \t\t\t\t  << std::endl;\n>  \t\t\treturn TestFail;\n>  \t\t}\n>\n> -\t\tif (!isValidFd(desc1_->fd())) {\n> +\t\tif (!isValidFd(desc1_->get())) {\n>  \t\t\tstd::cout << \"Failed fd validity after construction (move assignment)\"\n>  \t\t\t\t  << std::endl;\n>  \t\t\treturn TestFail;\n> --\n> Regards,\n>\n> Laurent Pinchart\n>","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 75F3EBDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Nov 2021 08:09:09 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 26BA9605A4;\n\tTue, 30 Nov 2021 09:09:09 +0100 (CET)","from relay11.mail.gandi.net (relay11.mail.gandi.net\n\t[217.70.178.231])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1D8B160230\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Nov 2021 09:09:08 +0100 (CET)","(Authenticated sender: jacopo@jmondi.org)\n\tby relay11.mail.gandi.net (Postfix) with ESMTPSA id 9A336100003;\n\tTue, 30 Nov 2021 08:09:07 +0000 (UTC)"],"Date":"Tue, 30 Nov 2021 09:10:00 +0100","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20211130081000.cogakur4f52cphpe@uno.localdomain>","References":"<20211130033820.18235-1-laurent.pinchart@ideasonboard.com>\n\t<20211130033820.18235-22-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20211130033820.18235-22-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v4 21/22] libcamera: base: shared_fd:\n\tRename fd() to get()","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21488,"web_url":"https://patchwork.libcamera.org/comment/21488/","msgid":"<CAO5uPHP1O+W8EmpXFTYoS3eSxyPrvAX2D_zTRzaYDUeMvmbEAw@mail.gmail.com>","date":"2021-12-01T05:32:15","subject":"Re: [libcamera-devel] [PATCH v4 21/22] libcamera: base: shared_fd:\n\tRename fd() to get()","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"content":"Hi Laurent,\n\nOn Tue, Nov 30, 2021 at 5:09 PM Jacopo Mondi <jacopo@jmondi.org> wrote:\n>\n> Hi Laurent\n>\n> On Tue, Nov 30, 2021 at 05:38:19AM +0200, Laurent Pinchart wrote:\n> > For consistency with UniqueFD, rename the fd() function to get().\n> > Renaming UniqueFD::get() to fd() would have been another option, but was\n> > rejected to keep as close as possible to the std::shared_ptr<> and\n> > std::unique_ptr<> APIs.\n> >\n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Hirokazu Honda <hiroh@chromium.org>\n>\n> I like this!\n>\n> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n> Thanks\n>   j\n>\n> > ---\n> >  include/libcamera/base/shared_fd.h            |  2 +-\n> >  include/libcamera/internal/v4l2_videodevice.h |  2 +-\n> >  src/cam/drm.cpp                               |  4 +-\n> >  src/cam/image.cpp                             |  4 +-\n> >  src/gstreamer/gstlibcameraallocator.cpp       |  2 +-\n> >  src/ipa/raspberrypi/raspberrypi.cpp           |  2 +-\n> >  src/libcamera/base/shared_fd.cpp              |  4 +-\n> >  src/libcamera/framebuffer.cpp                 |  2 +-\n> >  src/libcamera/ipc_pipe.cpp                    |  2 +-\n> >  src/libcamera/mapped_framebuffer.cpp          |  4 +-\n> >  .../pipeline/raspberrypi/raspberrypi.cpp      |  2 +-\n> >  src/libcamera/v4l2_videodevice.cpp            |  6 +--\n> >  src/v4l2/v4l2_camera.cpp                      |  2 +-\n> >  test/shared-fd.cpp                            | 39 ++++++++++---------\n> >  14 files changed, 39 insertions(+), 38 deletions(-)\n> >\n> > diff --git a/include/libcamera/base/shared_fd.h b/include/libcamera/base/shared_fd.h\n> > index 1dd51a7f046b..e53a8b88601e 100644\n> > --- a/include/libcamera/base/shared_fd.h\n> > +++ b/include/libcamera/base/shared_fd.h\n> > @@ -27,7 +27,7 @@ public:\n> >       SharedFD &operator=(SharedFD &&other);\n> >\n> >       bool isValid() const { return fd_ != nullptr; }\n> > -     int fd() const { return fd_ ? fd_->fd() : -1; }\n> > +     int get() const { return fd_ ? fd_->fd() : -1; }\n> >       UniqueFD dup() const;\n> >\n> >  private:\n> > diff --git a/include/libcamera/internal/v4l2_videodevice.h b/include/libcamera/internal/v4l2_videodevice.h\n> > index 5ba2b54643ac..9b2ec3afecff 100644\n> > --- a/include/libcamera/internal/v4l2_videodevice.h\n> > +++ b/include/libcamera/internal/v4l2_videodevice.h\n> > @@ -140,7 +140,7 @@ private:\n> >       private:\n> >               struct Plane {\n> >                       Plane(const FrameBuffer::Plane &plane)\n> > -                             : fd(plane.fd.fd()), length(plane.length)\n> > +                             : fd(plane.fd.get()), length(plane.length)\n> >                       {\n> >                       }\n> >\n> > diff --git a/src/cam/drm.cpp b/src/cam/drm.cpp\n> > index f25300913a7f..46e34eb546fb 100644\n> > --- a/src/cam/drm.cpp\n> > +++ b/src/cam/drm.cpp\n> > @@ -608,12 +608,12 @@ std::unique_ptr<FrameBuffer> Device::createFrameBuffer(\n> >\n> >       unsigned int i = 0;\n> >       for (const libcamera::FrameBuffer::Plane &plane : planes) {\n> > -             int fd = plane.fd.fd();\n> > +             int fd = plane.fd.get();\n> >               uint32_t handle;\n> >\n> >               auto iter = fb->planes_.find(fd);\n> >               if (iter == fb->planes_.end()) {\n> > -                     ret = drmPrimeFDToHandle(fd_, plane.fd.fd(), &handle);\n> > +                     ret = drmPrimeFDToHandle(fd_, plane.fd.get(), &handle);\n> >                       if (ret < 0) {\n> >                               ret = -errno;\n> >                               std::cerr\n> > diff --git a/src/cam/image.cpp b/src/cam/image.cpp\n> > index 0180be78d396..fe2cc6da5a15 100644\n> > --- a/src/cam/image.cpp\n> > +++ b/src/cam/image.cpp\n> > @@ -39,7 +39,7 @@ std::unique_ptr<Image> Image::fromFrameBuffer(const FrameBuffer *buffer, MapMode\n> >       std::map<int, MappedBufferInfo> mappedBuffers;\n> >\n> >       for (const FrameBuffer::Plane &plane : buffer->planes()) {\n> > -             const int fd = plane.fd.fd();\n> > +             const int fd = plane.fd.get();\n> >               if (mappedBuffers.find(fd) == mappedBuffers.end()) {\n> >                       const size_t length = lseek(fd, 0, SEEK_END);\n> >                       mappedBuffers[fd] = MappedBufferInfo{ nullptr, 0, length };\n> > @@ -61,7 +61,7 @@ std::unique_ptr<Image> Image::fromFrameBuffer(const FrameBuffer *buffer, MapMode\n> >       }\n> >\n> >       for (const FrameBuffer::Plane &plane : buffer->planes()) {\n> > -             const int fd = plane.fd.fd();\n> > +             const int fd = plane.fd.get();\n> >               auto &info = mappedBuffers[fd];\n> >               if (!info.address) {\n> >                       void *address = mmap(nullptr, info.mapLength, mmapFlags,\n> > diff --git a/src/gstreamer/gstlibcameraallocator.cpp b/src/gstreamer/gstlibcameraallocator.cpp\n> > index cb07d6e9e87f..c740b8fc82a8 100644\n> > --- a/src/gstreamer/gstlibcameraallocator.cpp\n> > +++ b/src/gstreamer/gstlibcameraallocator.cpp\n> > @@ -52,7 +52,7 @@ FrameWrap::FrameWrap(GstAllocator *allocator, FrameBuffer *buffer,\n> >         outstandingPlanes_(0)\n> >  {\n> >       for (const FrameBuffer::Plane &plane : buffer->planes()) {\n> > -             GstMemory *mem = gst_fd_allocator_alloc(allocator, plane.fd.fd(),\n> > +             GstMemory *mem = gst_fd_allocator_alloc(allocator, plane.fd.get(),\n> >                                                       plane.offset + plane.length,\n> >                                                       GST_FD_MEMORY_FLAG_DONT_CLOSE);\n> >               gst_memory_resize(mem, plane.offset, plane.length);\n> > diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\n> > index aaf629eeb3fc..0ed41385018a 100644\n> > --- a/src/ipa/raspberrypi/raspberrypi.cpp\n> > +++ b/src/ipa/raspberrypi/raspberrypi.cpp\n> > @@ -377,7 +377,7 @@ int IPARPi::configure(const IPACameraSensorInfo &sensorInfo,\n> >               lsTableHandle_ = std::move(ipaConfig.lsTableHandle);\n> >               if (lsTableHandle_.isValid()) {\n> >                       lsTable_ = mmap(nullptr, ipa::RPi::MaxLsGridSize, PROT_READ | PROT_WRITE,\n> > -                                     MAP_SHARED, lsTableHandle_.fd(), 0);\n> > +                                     MAP_SHARED, lsTableHandle_.get(), 0);\n> >\n> >                       if (lsTable_ == MAP_FAILED) {\n> >                               LOG(IPARPI, Error) << \"dmaHeap mmap failure for LS table.\";\n> > diff --git a/src/libcamera/base/shared_fd.cpp b/src/libcamera/base/shared_fd.cpp\n> > index 56dc579258c7..0c8b93a47f85 100644\n> > --- a/src/libcamera/base/shared_fd.cpp\n> > +++ b/src/libcamera/base/shared_fd.cpp\n> > @@ -208,7 +208,7 @@ SharedFD &SharedFD::operator=(SharedFD &&other)\n> >   */\n> >\n> >  /**\n> > - * \\fn SharedFD::fd()\n> > + * \\fn SharedFD::get()\n> >   * \\brief Retrieve the numerical file descriptor\n> >   * \\return The numerical file descriptor, which may be -1 if the SharedFD\n> >   * instance is invalid\n> > @@ -253,7 +253,7 @@ SharedFD &SharedFD::operator=(SharedFD &&other)\n> >   */\n> >  UniqueFD SharedFD::dup() const\n> >  {\n> > -     int dupFd = ::dup(fd());\n> > +     int dupFd = ::dup(get());\n> >       if (dupFd == -1) {\n> >               int ret = -errno;\n> >               LOG(SharedFD, Error)\n> > diff --git a/src/libcamera/framebuffer.cpp b/src/libcamera/framebuffer.cpp\n> > index f313566c5561..701212f3ae21 100644\n> > --- a/src/libcamera/framebuffer.cpp\n> > +++ b/src/libcamera/framebuffer.cpp\n> > @@ -218,7 +218,7 @@ ino_t fileDescriptorInode(const SharedFD &fd)\n> >               return 0;\n> >\n> >       struct stat st;\n> > -     int ret = fstat(fd.fd(), &st);\n> > +     int ret = fstat(fd.get(), &st);\n> >       if (ret < 0) {\n> >               ret = -errno;\n> >               LOG(Buffer, Fatal)\n> > diff --git a/src/libcamera/ipc_pipe.cpp b/src/libcamera/ipc_pipe.cpp\n> > index 3b47032de0a2..31a0ca09f9f0 100644\n> > --- a/src/libcamera/ipc_pipe.cpp\n> > +++ b/src/libcamera/ipc_pipe.cpp\n> > @@ -113,7 +113,7 @@ IPCUnixSocket::Payload IPCMessage::payload() const\n> >       }\n> >\n> >       for (const SharedFD &fd : fds_)\n> > -             payload.fds.push_back(fd.fd());\n> > +             payload.fds.push_back(fd.get());\n> >\n> >       return payload;\n> >  }\n> > diff --git a/src/libcamera/mapped_framebuffer.cpp b/src/libcamera/mapped_framebuffer.cpp\n> > index 464d35fef2d2..6860069b68ca 100644\n> > --- a/src/libcamera/mapped_framebuffer.cpp\n> > +++ b/src/libcamera/mapped_framebuffer.cpp\n> > @@ -198,7 +198,7 @@ MappedFrameBuffer::MappedFrameBuffer(const FrameBuffer *buffer, MapFlags flags)\n> >       std::map<int, MappedBufferInfo> mappedBuffers;\n> >\n> >       for (const FrameBuffer::Plane &plane : buffer->planes()) {\n> > -             const int fd = plane.fd.fd();\n> > +             const int fd = plane.fd.get();\n> >               if (mappedBuffers.find(fd) == mappedBuffers.end()) {\n> >                       const size_t length = lseek(fd, 0, SEEK_END);\n> >                       mappedBuffers[fd] = MappedBufferInfo{ nullptr, 0, length };\n> > @@ -220,7 +220,7 @@ MappedFrameBuffer::MappedFrameBuffer(const FrameBuffer *buffer, MapFlags flags)\n> >       }\n> >\n> >       for (const FrameBuffer::Plane &plane : buffer->planes()) {\n> > -             const int fd = plane.fd.fd();\n> > +             const int fd = plane.fd.get();\n> >               auto &info = mappedBuffers[fd];\n> >               if (!info.address) {\n> >                       void *address = mmap(nullptr, info.mapLength, mmapFlags,\n> > diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > index fdcd1eca11d6..fa2848533b29 100644\n> > --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > @@ -1470,7 +1470,7 @@ void RPiCameraData::setIspControls(const ControlList &controls)\n> >               Span<uint8_t> s = value.data();\n> >               bcm2835_isp_lens_shading *ls =\n> >                       reinterpret_cast<bcm2835_isp_lens_shading *>(s.data());\n> > -             ls->dmabuf = lsTable_.fd();\n> > +             ls->dmabuf = lsTable_.get();\n> >       }\n> >\n> >       isp_[Isp::Input].dev()->setControls(&ctrls);\n> > diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n> > index 0d214d9edc7a..b4b89e2759b9 100644\n> > --- a/src/libcamera/v4l2_videodevice.cpp\n> > +++ b/src/libcamera/v4l2_videodevice.cpp\n> > @@ -282,7 +282,7 @@ bool V4L2BufferCache::Entry::operator==(const FrameBuffer &buffer) const\n> >               return false;\n> >\n> >       for (unsigned int i = 0; i < planes.size(); i++)\n> > -             if (planes_[i].fd != planes[i].fd.fd() ||\n> > +             if (planes_[i].fd != planes[i].fd.get() ||\n> >                   planes_[i].length != planes[i].length)\n> >                       return false;\n> >       return true;\n> > @@ -1517,9 +1517,9 @@ int V4L2VideoDevice::queueBuffer(FrameBuffer *buffer)\n> >       if (buf.memory == V4L2_MEMORY_DMABUF) {\n> >               if (multiPlanar) {\n> >                       for (unsigned int p = 0; p < numV4l2Planes; ++p)\n> > -                             v4l2Planes[p].m.fd = planes[p].fd.fd();\n> > +                             v4l2Planes[p].m.fd = planes[p].fd.get();\n> >               } else {\n> > -                     buf.m.fd = planes[0].fd.fd();\n> > +                     buf.m.fd = planes[0].fd.get();\n> >               }\n> >       }\n> >\n> > diff --git a/src/v4l2/v4l2_camera.cpp b/src/v4l2/v4l2_camera.cpp\n> > index 464507505c79..e922b9e6aab2 100644\n> > --- a/src/v4l2/v4l2_camera.cpp\n> > +++ b/src/v4l2/v4l2_camera.cpp\n> > @@ -195,7 +195,7 @@ int V4L2Camera::getBufferFd(unsigned int index)\n> >       if (buffers.size() <= index)\n> >               return -1;\n> >\n> > -     return buffers[index]->planes()[0].fd.fd();\n> > +     return buffers[index]->planes()[0].fd.get();\n> >  }\n> >\n> >  int V4L2Camera::streamOn()\n> > diff --git a/test/shared-fd.cpp b/test/shared-fd.cpp\n> > index 60e5d0aaa395..997d7be18c47 100644\n> > --- a/test/shared-fd.cpp\n> > +++ b/test/shared-fd.cpp\n> > @@ -46,7 +46,7 @@ protected:\n> >               /* Test creating empty SharedFD. */\n> >               desc1_ = new SharedFD();\n> >\n> > -             if (desc1_->fd() != -1) {\n> > +             if (desc1_->get() != -1) {\n> >                       std::cout << \"Failed fd numerical check (default constructor)\"\n> >                                 << std::endl;\n> >                       return TestFail;\n> > @@ -60,19 +60,19 @@ protected:\n> >                * descriptor.\n> >                */\n> >               desc1_ = new SharedFD(fd_);\n> > -             if (desc1_->fd() == fd_) {\n> > +             if (desc1_->get() == fd_) {\n> >                       std::cout << \"Failed fd numerical check (lvalue ref constructor)\"\n> >                                 << std::endl;\n> >                       return TestFail;\n> >               }\n> >\n> > -             if (!isValidFd(fd_) || !isValidFd(desc1_->fd())) {\n> > +             if (!isValidFd(fd_) || !isValidFd(desc1_->get())) {\n> >                       std::cout << \"Failed fd validity after construction (lvalue ref constructor)\"\n> >                                 << std::endl;\n> >                       return TestFail;\n> >               }\n> >\n> > -             int fd = desc1_->fd();\n> > +             int fd = desc1_->get();\n> >\n> >               delete desc1_;\n> >               desc1_ = nullptr;\n> > @@ -91,19 +91,19 @@ protected:\n> >               int dupFdCopy = dupFd;\n> >\n> >               desc1_ = new SharedFD(std::move(dupFd));\n> > -             if (desc1_->fd() != dupFdCopy) {\n> > +             if (desc1_->get() != dupFdCopy) {\n> >                       std::cout << \"Failed fd numerical check (rvalue ref constructor)\"\n> >                                 << std::endl;\n> >                       return TestFail;\n> >               }\n> >\n> > -             if (dupFd != -1 || !isValidFd(fd_) || !isValidFd(desc1_->fd())) {\n> > +             if (dupFd != -1 || !isValidFd(fd_) || !isValidFd(desc1_->get())) {\n> >                       std::cout << \"Failed fd validity after construction (rvalue ref constructor)\"\n> >                                 << std::endl;\n> >                       return TestFail;\n> >               }\n> >\n> > -             fd = desc1_->fd();\n> > +             fd = desc1_->get();\n> >\n> >               delete desc1_;\n> >               desc1_ = nullptr;\n> > @@ -118,13 +118,14 @@ protected:\n> >               desc1_ = new SharedFD(fd_);\n> >               desc2_ = new SharedFD(*desc1_);\n> >\n> > -             if (desc1_->fd() == fd_ || desc2_->fd() == fd_ || desc1_->fd() != desc2_->fd()) {\n> > +             if (desc1_->get() == fd_ || desc2_->get() == fd_ ||\n> > +                 desc1_->get() != desc2_->get()) {\n> >                       std::cout << \"Failed fd numerical check (copy constructor)\"\n> >                                 << std::endl;\n> >                       return TestFail;\n> >               }\n> >\n> > -             if (!isValidFd(desc1_->fd()) || !isValidFd(desc2_->fd())) {\n> > +             if (!isValidFd(desc1_->get()) || !isValidFd(desc2_->get())) {\n> >                       std::cout << \"Failed fd validity after construction (copy constructor)\"\n> >                                 << std::endl;\n> >                       return TestFail;\n> > @@ -133,7 +134,7 @@ protected:\n> >               delete desc1_;\n> >               desc1_ = nullptr;\n> >\n> > -             if (!isValidFd(desc2_->fd())) {\n> > +             if (!isValidFd(desc2_->get())) {\n> >                       std::cout << \"Failed fd validity after destruction (copy constructor)\"\n> >                                 << std::endl;\n> >                       return TestFail;\n> > @@ -144,16 +145,16 @@ protected:\n> >\n> >               /* Test creating SharedFD by taking over other SharedFD. */\n> >               desc1_ = new SharedFD(fd_);\n> > -             fd = desc1_->fd();\n> > +             fd = desc1_->get();\n> >               desc2_ = new SharedFD(std::move(*desc1_));\n> >\n> > -             if (desc1_->fd() != -1 || desc2_->fd() != fd) {\n> > +             if (desc1_->get() != -1 || desc2_->get() != fd) {\n> >                       std::cout << \"Failed fd numerical check (move constructor)\"\n> >                                 << std::endl;\n> >                       return TestFail;\n> >               }\n> >\n> > -             if (!isValidFd(desc2_->fd())) {\n> > +             if (!isValidFd(desc2_->get())) {\n> >                       std::cout << \"Failed fd validity after construction (move constructor)\"\n> >                                 << std::endl;\n> >                       return TestFail;\n> > @@ -168,16 +169,16 @@ protected:\n> >               desc1_ = new SharedFD();\n> >               desc2_ = new SharedFD(fd_);\n> >\n> > -             fd = desc2_->fd();\n> > +             fd = desc2_->get();\n> >               *desc1_ = *desc2_;\n> >\n> > -             if (desc1_->fd() != fd || desc2_->fd() != fd) {\n> > +             if (desc1_->get() != fd || desc2_->get() != fd) {\n> >                       std::cout << \"Failed fd numerical check (copy assignment)\"\n> >                                 << std::endl;\n> >                       return TestFail;\n> >               }\n> >\n> > -             if (!isValidFd(desc1_->fd()) || !isValidFd(desc2_->fd())) {\n> > +             if (!isValidFd(desc1_->get()) || !isValidFd(desc2_->get())) {\n> >                       std::cout << \"Failed fd validity after construction (copy assignment)\"\n> >                                 << std::endl;\n> >                       return TestFail;\n> > @@ -192,16 +193,16 @@ protected:\n> >               desc1_ = new SharedFD();\n> >               desc2_ = new SharedFD(fd_);\n> >\n> > -             fd = desc2_->fd();\n> > +             fd = desc2_->get();\n> >               *desc1_ = std::move(*desc2_);\n> >\n> > -             if (desc1_->fd() != fd || desc2_->fd() != -1) {\n> > +             if (desc1_->get() != fd || desc2_->get() != -1) {\n> >                       std::cout << \"Failed fd numerical check (move assignment)\"\n> >                                 << std::endl;\n> >                       return TestFail;\n> >               }\n> >\n> > -             if (!isValidFd(desc1_->fd())) {\n> > +             if (!isValidFd(desc1_->get())) {\n> >                       std::cout << \"Failed fd validity after construction (move assignment)\"\n> >                                 << std::endl;\n> >                       return TestFail;\n> > --\n> > Regards,\n> >\n> > Laurent Pinchart\n> >","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 57AB8BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  1 Dec 2021 05:32:29 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A196F60710;\n\tWed,  1 Dec 2021 06:32:28 +0100 (CET)","from mail-ed1-x534.google.com (mail-ed1-x534.google.com\n\t[IPv6:2a00:1450:4864:20::534])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 36B4A60592\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  1 Dec 2021 06:32:26 +0100 (CET)","by mail-ed1-x534.google.com with SMTP id w1so96843338edc.6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Nov 2021 21:32:26 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"cIb5cWPC\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=5L3PSMsX4cHpOB9jni+1T0dLKdNHF1ib7izWFgy/V/g=;\n\tb=cIb5cWPCox4aUpaTESirFQPpDH+ODRS1WMZtsTIUAPgkFyTchCbIjoO0GCxNBr6bWQ\n\tI8mAvkBTsO9CanOozXp/7W42paJbxd1xMvGj6VLdDPt4hPWqVI5CHqTuqaOm9Cdo8iKv\n\tImtpsGQc+lu7HY+r9X/TZKomZOWXlB7RbiOm4=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=5L3PSMsX4cHpOB9jni+1T0dLKdNHF1ib7izWFgy/V/g=;\n\tb=pn0opgS2xRkXshFK+M7Sc8vC4RV7eSg2uBt87XLzVM8o7qjOnel3yDFOQ6F72GvSwU\n\tvCHN+v0yM/HhGnfi/kxPiFZ+wOlz5x/I9VGIV2iZT0V533TSBAiflFquyG7YW0MJIhSn\n\tR+VK+Xx664vHcy8uSQ0rURk/vkwPKwsOI8NjUbgJ4ACQ0UKpPkim0EfQIpK8M1lk9I/s\n\t1iw8npDAPMUX7fiI9BnzXzU3r71mtmcOlSfO/kTOWcH4/rjI8v8+a7bl3BDMrKbEhdlI\n\tr/u95bX/20irmI8YTQjFS7UeguCZATjUIgCDBGmv8s0HTGev4bND0GbzBP+tMlqoGvR2\n\tyqLQ==","X-Gm-Message-State":"AOAM533SSJobz4CP2DU8ix8HdrHrWlb/AospF+aawk8TydkrJ7yZ5zr0\n\te6DVo03WR0pLG7Mt2fFu1hcOptPDdqoet9TBeBojZQ==","X-Google-Smtp-Source":"ABdhPJxllhCmykU9Kq1xuBia5ylkAUXB6S4CWwVlmRvQcOWvAOqNHi4DDyylWyGDmuQmgZEt4BykUUetqWbOK3Fce9Y=","X-Received":"by 2002:a17:906:52d8:: with SMTP id\n\tw24mr4694467ejn.296.1638336745452; \n\tTue, 30 Nov 2021 21:32:25 -0800 (PST)","MIME-Version":"1.0","References":"<20211130033820.18235-1-laurent.pinchart@ideasonboard.com>\n\t<20211130033820.18235-22-laurent.pinchart@ideasonboard.com>\n\t<20211130081000.cogakur4f52cphpe@uno.localdomain>","In-Reply-To":"<20211130081000.cogakur4f52cphpe@uno.localdomain>","From":"Hirokazu Honda <hiroh@chromium.org>","Date":"Wed, 1 Dec 2021 14:32:15 +0900","Message-ID":"<CAO5uPHP1O+W8EmpXFTYoS3eSxyPrvAX2D_zTRzaYDUeMvmbEAw@mail.gmail.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v4 21/22] libcamera: base: shared_fd:\n\tRename fd() to get()","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]