{"id":19874,"url":"https://patchwork.libcamera.org/api/patches/19874/?format=json","web_url":"https://patchwork.libcamera.org/patch/19874/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20240416091357.211951-6-mzamazal@redhat.com>","date":"2024-04-16T09:13:41","name":"[v8,05/18] libcamera: shared_mem_object: Rename SIZE constant to `size'","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"1dbc073aed5faec5a73418102e672977054bfa28","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/?format=json","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/19874/mbox/","series":[{"id":4257,"url":"https://patchwork.libcamera.org/api/series/4257/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4257","date":"2024-04-16T09:13:36","name":"libcamera: introduce Software ISP and Software IPA","version":8,"mbox":"https://patchwork.libcamera.org/series/4257/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/19874/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/19874/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 95354BE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 16 Apr 2024 09:14:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4751363366;\n\tTue, 16 Apr 2024 11:14:41 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1AB746333E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Apr 2024 11:14:38 +0200 (CEST)","from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73])\n\tby relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n\tcipher=TLS_AES_256_GCM_SHA384) id us-mta-332-DUUxBRMZNAa_mm1dIMQfGA-1;\n\tTue, 16 Apr 2024 05:14:33 -0400","from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4])\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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 988D93C000BD;\n\tTue, 16 Apr 2024 09:14:32 +0000 (UTC)","from nuthatch.redhat.com (unknown [10.45.225.245])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id A13532026962;\n\tTue, 16 Apr 2024 09:14:30 +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=\"i8rooDK2\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1713258877;\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=7BCRbcxkVo7Yh5pTHgORL+FHsNnPDTu9iruHjmQY4l4=;\n\tb=i8rooDK2ERX4e5l6D12P/hnQ12qKeIwje6Ke9IitwX/now7SwlSNelra+ypcDHCpndaqFO\n\tcmW3GjOo8iw6kZKqMrSwTS1dFhPyCamru3c7eLZBZgdQJmIQoAlYJbZG9H6UOo0wgOi2jY\n\tLiCb84jUF+7YT/cZM6+pNtSFjB4YvII=","X-MC-Unique":"DUUxBRMZNAa_mm1dIMQfGA-1","From":"Milan Zamazal <mzamazal@redhat.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Milan Zamazal <mzamazal@redhat.com>,\n\tAndrei Konovalov <andrey.konovalov.ynk@gmail.com>,\n\tBryan O'Donoghue <bryan.odonoghue@linaro.org>,\n\tMaxime Ripard <mripard@redhat.com>, Pavel Machek <pavel@ucw.cz>,\n\tHans de Goede <hdegoede@redhat.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","Subject":"[PATCH v8 05/18] libcamera: shared_mem_object: Rename SIZE constant\n\tto `size'","Date":"Tue, 16 Apr 2024 11:13:41 +0200","Message-ID":"<20240416091357.211951-6-mzamazal@redhat.com>","In-Reply-To":"<20240416091357.211951-1-mzamazal@redhat.com>","References":"<20240416091357.211951-1-mzamazal@redhat.com>","MIME-Version":"1.0","X-Scanned-By":"MIMEDefang 3.4.1 on 10.11.54.4","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 SharedMemObject has been imported directly into the libcamera\ninternal components. Adapt the SIZE constant of the class to match the\nlibcamera coding style.\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nSigned-off-by: Milan Zamazal <mzamazal@redhat.com>\n---\n include/libcamera/internal/shared_mem_object.h | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)","diff":"diff --git a/include/libcamera/internal/shared_mem_object.h b/include/libcamera/internal/shared_mem_object.h\nindex 98636b44..a9970059 100644\n--- a/include/libcamera/internal/shared_mem_object.h\n+++ b/include/libcamera/internal/shared_mem_object.h\n@@ -23,7 +23,7 @@ template<class T>\n class SharedMemObject\n {\n public:\n-\tstatic constexpr std::size_t SIZE = sizeof(T);\n+\tstatic constexpr std::size_t kSize = sizeof(T);\n \n \tSharedMemObject()\n \t\t: obj_(nullptr)\n@@ -45,11 +45,11 @@ public:\n \t\tif (!fd_.isValid())\n \t\t\treturn;\n \n-\t\tret = ftruncate(fd_.get(), SIZE);\n+\t\tret = ftruncate(fd_.get(), kSize);\n \t\tif (ret < 0)\n \t\t\treturn;\n \n-\t\tmem = mmap(nullptr, SIZE, PROT_READ | PROT_WRITE, MAP_SHARED,\n+\t\tmem = mmap(nullptr, kSize, PROT_READ | PROT_WRITE, MAP_SHARED,\n \t\t\t   fd_.get(), 0);\n \t\tif (mem == MAP_FAILED)\n \t\t\treturn;\n@@ -69,7 +69,7 @@ public:\n \t{\n \t\tif (obj_) {\n \t\t\tobj_->~T();\n-\t\t\tmunmap(obj_, SIZE);\n+\t\t\tmunmap(obj_, kSize);\n \t\t}\n \t}\n \n","prefixes":["v8","05/18"]}