From patchwork Tue Apr 16 09:13:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 19874 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 95354BE08B for ; Tue, 16 Apr 2024 09:14:41 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4751363366; Tue, 16 Apr 2024 11:14:41 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="i8rooDK2"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1AB746333E for ; Tue, 16 Apr 2024 11:14:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713258877; 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=7BCRbcxkVo7Yh5pTHgORL+FHsNnPDTu9iruHjmQY4l4=; b=i8rooDK2ERX4e5l6D12P/hnQ12qKeIwje6Ke9IitwX/now7SwlSNelra+ypcDHCpndaqFO cmW3GjOo8iw6kZKqMrSwTS1dFhPyCamru3c7eLZBZgdQJmIQoAlYJbZG9H6UOo0wgOi2jY LiCb84jUF+7YT/cZM6+pNtSFjB4YvII= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-332-DUUxBRMZNAa_mm1dIMQfGA-1; Tue, 16 Apr 2024 05:14:33 -0400 X-MC-Unique: DUUxBRMZNAa_mm1dIMQfGA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (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 988D93C000BD; Tue, 16 Apr 2024 09:14:32 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.245]) by smtp.corp.redhat.com (Postfix) with ESMTP id A13532026962; Tue, 16 Apr 2024 09:14:30 +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 v8 05/18] libcamera: shared_mem_object: Rename SIZE constant to `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 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" The SharedMemObject has been imported directly into the libcamera internal components. Adapt the SIZE constant of the class to match the libcamera coding style. Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart Signed-off-by: Milan Zamazal --- 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..a9970059 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 kSize = sizeof(T); SharedMemObject() : obj_(nullptr) @@ -45,11 +45,11 @@ public: if (!fd_.isValid()) return; - ret = ftruncate(fd_.get(), SIZE); + ret = ftruncate(fd_.get(), kSize); if (ret < 0) return; - mem = mmap(nullptr, SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, + mem = mmap(nullptr, kSize, 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_, kSize); } }