High Flow Next power is reported in watts. Multiplying the 16-bit value
by one million can overflow both the signed intermediate and the u32
cache. Store power in long, perform the conversion in u64, and clamp to
LONG_MAX. The other existing power conversions fit in a signed 32-bit
value. Return ENODATA for unavailable power instead of exposing the
stored error as a reading.
Widen the shared current cache to u32. The Aquastream XT calibration can
exceed 65535 mA; clamp its negative calibration results to zero before
assigning to the unsigned cache. This also permits devices with scaled
aggregate currents to store milliamperes directly.
Assisted-by: LLM sparse
Signed-off-by: Vas Zayarskiy <redacted>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260914233728.22725-1-contact@vasily.cc?part=2