| Message ID | 20260507161101.7D2CD1EA006B@mailuser.phl.internal |
|---|---|
| State | New |
| Headers | show |
| Series |
|
| Related | show |
diff --git a/src/libcamera/software_isp/swstats_cpu.cpp b/src/libcamera/software_isp/swstats_cpu.cpp index b40d3334..d9011f41 100644 --- a/src/libcamera/software_isp/swstats_cpu.cpp +++ b/src/libcamera/software_isp/swstats_cpu.cpp @@ -362,11 +362,9 @@ void SwStatsCpu::finishFrame(uint32_t frame, uint32_t bufferId) for (unsigned int j = 0; j < SwIspStats::kYHistogramSize; j++) sharedStats_->yHistogram[j] += s.yHistogram[j]; } - if (sumShift_) { - sharedStats_->sum_.r() >>= sumShift_; - sharedStats_->sum_.g() >>= sumShift_; - sharedStats_->sum_.b() >>= sumShift_; - } + sharedStats_->sum_.r() >>= sumShift_; + sharedStats_->sum_.g() >>= sumShift_; + sharedStats_->sum_.b() >>= sumShift_; } sharedStats_->valid = valid;
Right-shifting by zero is a no-op, so the if (sumShift_) check before the three >>= sumShift_ assignments is unnecessary. Remove it. Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Suggested-by: Barnabas Pocze <barnabas.pocze@ideasonboard.com> Signed-off-by: Javier Tia <floss@jetm.me> --- src/libcamera/software_isp/swstats_cpu.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)