From patchwork Mon Oct 13 14:23:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 24613 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 C796FBF415 for ; Mon, 13 Oct 2025 14:23:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 03CA4604F4; Mon, 13 Oct 2025 16:23:38 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="wk9RxVMI"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7071C6031A for ; Mon, 13 Oct 2025 16:23:36 +0200 (CEST) Received: from pendragon.ideasonboard.com (82-203-166-19.bb.dnainternet.fi [82.203.166.19]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 6B59D183; Mon, 13 Oct 2025 16:21:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1760365318; bh=RjB/COCbtcIivRvltMUt7rODDYE3Wys6iv/Azuyj4fM=; h=From:To:Cc:Subject:Date:From; b=wk9RxVMIgOv7GrRU2vlC64fntrAEv9FyXgCc99CvFIT0A/ZQk3p3s2mGS2lU2FdFm QZ/8nxRww6RbuQmzOu4a8R1CZUXCXh26P1kqO46UKGXrqx4SyypEuL1Akem43STdpH eWUytybaj7U/N5phphhqspWBnDkVhLqEkme4ZJSM= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: Robert Mader Subject: [PATCH] pipeline: simple: Avoid overusage of auto variables Date: Mon, 13 Oct 2025 17:23:29 +0300 Message-ID: <20251013142329.1386-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.49.1 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" Using auto variables for simple types reduces readability. Spell out unsigned int explicitly here, and replace the <= 0 check with a zero check now that the explicit type shows the value can't be negative. Signed-off-by: Laurent Pinchart Reviewed-by: Umang Jain Reviewed-by: Kieran Bingham --- src/libcamera/pipeline/simple/simple.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) base-commit: 05bfebed2657cc1d032c9796efd9041bfbdc881c diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index dec9f6514f8c..7b0783cdbc32 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -1266,8 +1266,8 @@ CameraConfiguration::Status SimpleCameraConfiguration::validate() cfg.frameSize = format.planes[0].size; } - const auto bufferCount = cfg.bufferCount; - if (bufferCount <= 0) + const unsigned int bufferCount = cfg.bufferCount; + if (!bufferCount) cfg.bufferCount = kNumBuffersDefault; else if (bufferCount > kNumBuffersMax) cfg.bufferCount = kNumBuffersMax;