Actions
Bug #3025
opensys/dev/powermng/powernow/powernow.c:284: bad comparison ?
Start date:
04/11/2017
Due date:
% Done:
0%
Estimated time:
Description
sys/dev/powermng/powernow/powernow.c:284]: (style) Checking if unsigned variable 'vco_fid-vco_cfid' is less than zero.
Source code is
while (abs(vco_fid - vco_cfid) > 2) {
but
uint32_t vco_fid, vco_cfid;
which means the expression given to abs is unsigned.
So the code only seems to do a one-sided test.
Files
Updated by lubos over 7 years ago
Attaching patch. Replace abs with diff macro.
Regards,
Lubos Boucek
Actions