From patchwork Fri Aug 15 11:33:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 24137 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 8AA05BEFBE for ; Fri, 15 Aug 2025 11:34:41 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A04FE69251; Fri, 15 Aug 2025 13:34:40 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="GSePDtPM"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9230061443 for ; Fri, 15 Aug 2025 13:34:31 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 8728E6A8; Fri, 15 Aug 2025 13:33:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1755257616; bh=y38SG3xNuZuULB3Zxaqk+jL2f/qgvZPgeeC1na8h2yc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GSePDtPMoLW5x1uTl9WKnPCRZ9fQG8F0LAf9LitKtQkj7BE6u1vwwI8QVla45K0QH cD6AN22hgD3L6Jxt/deayzqOTVtDDvFm1Ek+jMiw0GEWrky/MbT+aHx2M57wtnm0gP dIJ3yCVXHBHSm3gOD/KTNK6047s/hspO8+nTCuKU= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: =?utf-8?q?Daniel_R=C3=A1kos?= Subject: [PATCH v2 7/8] apps: cam: drm: Drop unneeded local variable Date: Fri, 15 Aug 2025 14:33:59 +0300 Message-ID: <20250815113400.20623-8-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.49.1 In-Reply-To: <20250815113400.20623-1-laurent.pinchart@ideasonboard.com> References: <20250815113400.20623-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 planes variable in the Device::createFrameBuffer() function is a reference to buffer.planes() that is only used as a range initializer in a range-based for loop. Use buffer.planes() directly and drop the variable. Signed-off-by: Laurent Pinchart Reviewed-by: Barnabás Pőcze Reviewed-by: Jacopo Mondi --- src/apps/cam/drm.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/apps/cam/drm.cpp b/src/apps/cam/drm.cpp index f4b47097649a..8e2dfd9a64e4 100644 --- a/src/apps/cam/drm.cpp +++ b/src/apps/cam/drm.cpp @@ -659,10 +659,8 @@ std::unique_ptr Device::createFrameBuffer( uint32_t offsets[4] = {}; int ret; - const std::vector &planes = buffer.planes(); - unsigned int i = 0; - for (const libcamera::FrameBuffer::Plane &plane : planes) { + for (const libcamera::FrameBuffer::Plane &plane : buffer.planes()) { int fd = plane.fd.get(); uint32_t handle;