From patchwork Thu Jun 11 01:17:18 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 26867 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 369FFC328C for ; Thu, 11 Jun 2026 01:17:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D419361F31; Thu, 11 Jun 2026 03:17:29 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="uQlEIb8t"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 766EA6139A for ; Thu, 11 Jun 2026 03:17:26 +0200 (CEST) Received: from killaraus.ideasonboard.com (2001-14ba-70f3-e800--a06.rev.dnainternet.fi [IPv6:2001:14ba:70f3:e800::a06]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id EC60BD0 for ; Thu, 11 Jun 2026 03:16:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1781140617; bh=b/HA4Q0OBzOwZzIXAztr6MofyzZ68ebScap0wcHWEN8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=uQlEIb8tn1rp6jQtkLFqAEQnbze2BKHWWXu5z+SKAa14AKtBVl9GoGT1WPKsLJumk uyWrB8RJSM4nHdIuzTJhcmgQmd2sZJXrqgEI7lTd+Wg1KiwvOzgP+4eGVoFDUMXWOy ap1UnV8eHg7ord77xT0btdfEsSgJD3VtfRh4z6og= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH 2/6] libcamera: matrix: Rename data validation function Date: Thu, 11 Jun 2026 04:17:18 +0300 Message-ID: <20260611011722.1767689-3-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260611011722.1767689-1-laurent.pinchart@ideasonboard.com> References: <20260611011722.1767689-1-laurent.pinchart@ideasonboard.com> 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" The matrixValidateYaml() function predates the refactoring of YamlObject and its rename to ValueNode. It now operates on a ValudeNode, disconnected from the YAML parser. Rename it to matrixValidateValueNode() accordingly. While at it, fold consecutive __DOXYGEN__ conditional blocks into a single one. Signed-off-by: Laurent Pinchart --- include/libcamera/internal/matrix.h | 6 ++---- src/libcamera/matrix.cpp | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/libcamera/internal/matrix.h b/include/libcamera/internal/matrix.h index 0f72263f2536..137eb65e0c52 100644 --- a/include/libcamera/internal/matrix.h +++ b/include/libcamera/internal/matrix.h @@ -188,10 +188,8 @@ constexpr Matrix operator+(const Matrix &m1, const } #ifndef __DOXYGEN__ -bool matrixValidateYaml(const ValueNode &obj, unsigned int size); -#endif /* __DOXYGEN__ */ +bool matrixValidateValueNode(const ValueNode &obj, unsigned int size); -#ifndef __DOXYGEN__ template std::ostream &operator<<(std::ostream &out, const Matrix &m) { @@ -203,7 +201,7 @@ template struct ValueNode::Accessor> { std::optional> get(const ValueNode &obj) const { - if (!matrixValidateYaml(obj, Rows * Cols)) + if (!matrixValidateValueNode(obj, Rows * Cols)) return std::nullopt; Matrix matrix; diff --git a/src/libcamera/matrix.cpp b/src/libcamera/matrix.cpp index 4fe210830421..e4fb8d35314d 100644 --- a/src/libcamera/matrix.cpp +++ b/src/libcamera/matrix.cpp @@ -314,7 +314,7 @@ template bool matrixInvert(Span data, Span dataOut * to the product of the number of rows and columns of the matrix (Rows x * Cols). The values shall be stored in row-major order. */ -bool matrixValidateYaml(const ValueNode &obj, unsigned int size) +bool matrixValidateValueNode(const ValueNode &obj, unsigned int size) { if (!obj.isList()) return false;