From patchwork Thu Nov 13 13:58:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 25029 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 DCC1EC3241 for ; Thu, 13 Nov 2025 13:58:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B476260A8B; Thu, 13 Nov 2025 14:58:45 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="gumHmM/d"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C982960805 for ; Thu, 13 Nov 2025 14:58:43 +0100 (CET) Received: from pb-laptop.local (185.221.140.239.nat.pool.zt.hu [185.221.140.239]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6E243446; Thu, 13 Nov 2025 14:56:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1763042203; bh=+nx0ATjEZzJ4GKE51fEjyqffVAH2f6nDaiUQuI5/Rd8=; h=From:To:Cc:Subject:Date:From; b=gumHmM/dXH5L2gVb2KYo75B+BgqSFWAJ9M3XS3chlJkvGmPTlo5a2ejW19hvLHxIA kUfrC3IHUkLzoqVhv0J57Pt2fRrYko+TEYbxddMOFdH+9OM4fkXXfmwO1uOm7iTB7Q 1PWN0kO0MFGpJisvVxZafL0XqnwpMR2LfEQ9MVoA= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Laurent Pinchart , Nicolas Dufresne Subject: [PATCH v1] gstreamer: allocator: Remove use of `g_once_init_*()` Date: Thu, 13 Nov 2025 14:58:40 +0100 Message-ID: <20251113135840.610653-1-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.51.2 MIME-Version: 1.0 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" `g_once_init_enter()` can trigger `-Wvolatile` in certain configurations, so replace it by just a normal initialization since the required synchronization is guaranteed since C++11. Additionally, switch to using `g_quark_from_static_string()` since a string literal is used. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart --- src/gstreamer/gstlibcameraallocator.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/gstreamer/gstlibcameraallocator.cpp b/src/gstreamer/gstlibcameraallocator.cpp index d4492d994b..164f16b1be 100644 --- a/src/gstreamer/gstlibcameraallocator.cpp +++ b/src/gstreamer/gstlibcameraallocator.cpp @@ -76,12 +76,7 @@ FrameWrap::~FrameWrap() GQuark FrameWrap::getQuark() { - static gsize frame_quark = 0; - - if (g_once_init_enter(&frame_quark)) { - GQuark quark = g_quark_from_string("GstLibcameraFrameWrap"); - g_once_init_leave(&frame_quark, quark); - } + static const GQuark frame_quark = g_quark_from_static_string("GstLibcameraFrameWrap"); return frame_quark; }