Project

General

Profile

Bug #3025

sys/dev/powermng/powernow/powernow.c:284: bad comparison ?

Added by dcb 15 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
04/11/2017
Due date:
% Done:

0%


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.

Also available in: Atom PDF