Patch Detail
Show a patch.
GET /api/1.1/patches/2358/?format=api
{ "id": 2358, "url": "https://patchwork.libcamera.org/api/1.1/patches/2358/?format=api", "web_url": "https://patchwork.libcamera.org/patch/2358/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20191126233620.1695316-11-niklas.soderlund@ragnatech.se>", "date": "2019-11-26T23:36:00", "name": "[libcamera-devel,10/30] libcamera: buffer: Drop private function setRequest()", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "95dc5b7a9c032b4a3da4fc2d005e3604bc1da3b8", "submitter": { "id": 5, "url": "https://patchwork.libcamera.org/api/1.1/people/5/?format=api", "name": "Niklas Söderlund", "email": "niklas.soderlund@ragnatech.se" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/2358/mbox/", "series": [ { "id": 579, "url": "https://patchwork.libcamera.org/api/1.1/series/579/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=579", "date": "2019-11-26T23:35:50", "name": "libcamera: Rework buffer API", "version": 1, "mbox": "https://patchwork.libcamera.org/series/579/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/2358/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/2358/checks/", "tags": {}, "headers": { "Return-Path": "<niklas.soderlund@ragnatech.se>", "Received": [ "from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net\n\t[195.74.38.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7FFA861C8E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Nov 2019 00:39:32 +0100 (CET)", "from bismarck.berto.se (p54ac5865.dip0.t-ipconnect.de\n\t[84.172.88.101]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA\n\tid fe29bf64-10a5-11ea-a0b9-005056917f90;\n\tWed, 27 Nov 2019 00:39:31 +0100 (CET)" ], "X-Halon-ID": "fe29bf64-10a5-11ea-a0b9-005056917f90", "Authorized-sender": "niklas@soderlund.pp.se", "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Wed, 27 Nov 2019 00:36:00 +0100", "Message-Id": "<20191126233620.1695316-11-niklas.soderlund@ragnatech.se>", "X-Mailer": "git-send-email 2.24.0", "In-Reply-To": "<20191126233620.1695316-1-niklas.soderlund@ragnatech.se>", "References": "<20191126233620.1695316-1-niklas.soderlund@ragnatech.se>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 10/30] libcamera: buffer: Drop private\n\tfunction setRequest()", "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>", "X-List-Received-Date": "Tue, 26 Nov 2019 23:39:33 -0000" }, "content": "There is no need to have a private helper function to access a private\ndata member when a friend statement is needed anyhow. Remove the helper\nfunction to simplify the code and make it clear that a private member of\nBuffer is accessed.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n include/libcamera/buffer.h | 2 --\n src/libcamera/buffer.cpp | 8 --------\n src/libcamera/request.cpp | 4 ++--\n 3 files changed, 2 insertions(+), 12 deletions(-)", "diff": "diff --git a/include/libcamera/buffer.h b/include/libcamera/buffer.h\nindex afcef805801a43b5..d6db6138ca11d5fe 100644\n--- a/include/libcamera/buffer.h\n+++ b/include/libcamera/buffer.h\n@@ -135,8 +135,6 @@ private:\n \n \tvoid cancel();\n \n-\tvoid setRequest(Request *request) { request_ = request; }\n-\n \tunsigned int index_;\n \tstd::array<int, 3> dmabuf_;\n \tBufferMemory *mem_;\ndiff --git a/src/libcamera/buffer.cpp b/src/libcamera/buffer.cpp\nindex 82b4799a2510d02f..7043345c3f3207cd 100644\n--- a/src/libcamera/buffer.cpp\n+++ b/src/libcamera/buffer.cpp\n@@ -462,7 +462,6 @@ Buffer::Buffer(unsigned int index, const Buffer *metadata)\n *\n * \\return The Request the Buffer belongs to, or nullptr if the buffer is\n * either completed or not associated with a request\n- * \\sa Buffer::setRequest()\n */\n \n /**\n@@ -489,13 +488,6 @@ void Buffer::cancel()\n \tstatus_ = BufferCancelled;\n }\n \n-/**\n- * \\fn Buffer::setRequest()\n- * \\brief Set the request this buffer belongs to\n- *\n- * The intended callers are Request::prepare() and Request::completeBuffer().\n- */\n-\n /**\n * \\class FrameBuffer\n * \\brief A buffer handle and dynamic metadata\ndiff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp\nindex c14ed1a4d3ce55d0..c2854dc2e8caab2e 100644\n--- a/src/libcamera/request.cpp\n+++ b/src/libcamera/request.cpp\n@@ -220,7 +220,7 @@ int Request::prepare()\n \n \tfor (auto const &pair : bufferMap_) {\n \t\tBuffer *buffer = pair.second;\n-\t\tbuffer->setRequest(this);\n+\t\tbuffer->request_ = this;\n \t\tpending_.insert(buffer);\n \t}\n \n@@ -258,7 +258,7 @@ bool Request::completeBuffer(Buffer *buffer)\n \tint ret = pending_.erase(buffer);\n \tASSERT(ret == 1);\n \n-\tbuffer->setRequest(nullptr);\n+\tbuffer->request_ = nullptr;\n \n \tif (buffer->status() == Buffer::BufferCancelled)\n \t\tcancelled_ = true;\n", "prefixes": [ "libcamera-devel", "10/30" ] }