From 6e68c391f84935c1e8a1b752c1857f1c0da74469 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 15 Aug 2025 12:59:14 +0300 Subject: [PATCH] apps: cam: drm: Drop unneeded local variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 f4b47097..8e2dfd9a 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;