On Tue, Dec 2, 2025 at 8:13 PM Thorsten Blum thorsten.blum@linux.dev wrote:
The local variable 'curr_energy' was never clamped to PAC_193X_MIN_POWER_ACC or PAC_193X_MAX_POWER_ACC because the return value of clamp() was not used. Fix this by assigning the clamped value back to 'curr_energy'.
...
/* add the power_acc field */ curr_energy += inc;
clamp(curr_energy, PAC_193X_MIN_POWER_ACC, PAC_193X_MAX_POWER_ACC);
curr_energy = clamp(curr_energy, PAC_193X_MIN_POWER_ACC,PAC_193X_MAX_POWER_ACC); reg_data->energy_sec_acc[cnt] = curr_energy;
Hmm... Maybe
reg_data->energy_sec_acc[cnt] = clamp(curr_energy, PAC_193X_MIN_POWER_ACC, PAC_193X_MAX_POWER_ACC);
?