[libcamera-devel] [PATCH] libcamera: v4l2_device: Remove unused set of ret

Niklas Söderlund niklas.soderlund at ragnatech.se
Wed Oct 28 02:21:14 CET 2020


The last assignment of the ret variable in getControls() is not consumed
so it's unnecessary to set it. This likely originates from a similar
code flow in setControls() where the ret variable is later consumed.

Signed-off-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
---
 src/libcamera/v4l2_device.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp
index 31d4dad0ee47b734..f747ba790886cfe0 100644
--- a/src/libcamera/v4l2_device.cpp
+++ b/src/libcamera/v4l2_device.cpp
@@ -243,7 +243,6 @@ ControlList V4L2Device::getControls(const std::vector<uint32_t> &ids)
 		LOG(V4L2, Error) << "Unable to read control " << errorIdx
 				 << ": " << strerror(-ret);
 		count = errorIdx - 1;
-		ret = errorIdx;
 	}
 
 	updateControls(&ctrls, v4l2Ctrls, count);
-- 
2.29.1



More information about the libcamera-devel mailing list