From f4604eb152f5d24370c1160a2f10dcab87b1ef21 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 13 Oct 2025 16:22:51 +0300 Subject: [PATCH] pipeline: simple: Avoid overusage of auto variables 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(-) diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index dec9f651..7b0783cd 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;