diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp
index 5ae5b647164329573f0a233ee36d1db7b3683ef9..0eb05c2b6e1ac9e159e050bae3d5c56ec3045299 100644
--- a/src/ipa/rkisp1/algorithms/awb.cpp
+++ b/src/ipa/rkisp1/algorithms/awb.cpp
@@ -332,7 +332,7 @@ void Awb::process(IPAContext &context,
 	 * divisions by zero when computing the raw means in subsequent
 	 * iterations.
 	 */
-	awbResult.gains = awbResult.gains.max(1.0 / 256).min(1023.0 / 256);
+	awbResult.gains = awbResult.gains.clamp(1.0 / 256, 1023.0 / 256);
 
 	/* Filter the values to avoid oscillations. */
 	double speed = 0.2;
