From patchwork Thu Apr 4 08:46:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 19826 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 68D14C0DA4 for ; Thu, 4 Apr 2024 08:47:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id F168B6337B; Thu, 4 Apr 2024 10:47:43 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="Y3N5ALqi"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9016C63373 for ; Thu, 4 Apr 2024 10:47:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712220459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q/fnpole15IRJHX0kIbNArAeCIl1FNycylWyXAbXVOc=; b=Y3N5ALqiYcOzKU5UhYGiMtm5p+lksAQhkBkP1N0kCojeWO+HCHeFDzluEBKkocyTTqBpY9 kHpe8Ch8/mplVITtpRtnwqihukaX5O4X1vXX7liXsMAUSTJSv9IOjccGJBHlVfdY7sffOB 4iiOzKe1lXqR92gbJzwUtx7dR3gY2Og= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-683-CVJmlfMnPK63hsZmLYDSUA-1; Thu, 04 Apr 2024 04:47:34 -0400 X-MC-Unique: CVJmlfMnPK63hsZmLYDSUA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AD3F585CDF5; Thu, 4 Apr 2024 08:47:33 +0000 (UTC) Received: from nuthatch.brq.redhat.com (unknown [10.43.17.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 726858173; Thu, 4 Apr 2024 08:47:32 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal , Andrei Konovalov , Bryan O'Donoghue , Maxime Ripard , Pavel Machek , Hans de Goede , Kieran Bingham , Laurent Pinchart Subject: [PATCH v7 05/18] libcamera: shared_mem_object: Rename SIZE constant to `size' Date: Thu, 4 Apr 2024 10:46:42 +0200 Message-ID: <20240404084657.353464-6-mzamazal@redhat.com> In-Reply-To: <20240404084657.353464-1-mzamazal@redhat.com> References: <20240404084657.353464-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Signed-off-by: Milan Zamazal Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- include/libcamera/internal/shared_mem_object.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/libcamera/internal/shared_mem_object.h b/include/libcamera/internal/shared_mem_object.h index 98636b44..8f2e7120 100644 --- a/include/libcamera/internal/shared_mem_object.h +++ b/include/libcamera/internal/shared_mem_object.h @@ -23,7 +23,7 @@ template class SharedMemObject { public: - static constexpr std::size_t SIZE = sizeof(T); + static constexpr std::size_t size = sizeof(T); SharedMemObject() : obj_(nullptr) @@ -45,11 +45,11 @@ public: if (!fd_.isValid()) return; - ret = ftruncate(fd_.get(), SIZE); + ret = ftruncate(fd_.get(), size); if (ret < 0) return; - mem = mmap(nullptr, SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, + mem = mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd_.get(), 0); if (mem == MAP_FAILED) return; @@ -69,7 +69,7 @@ public: { if (obj_) { obj_->~T(); - munmap(obj_, SIZE); + munmap(obj_, size); } }