[DragonFlyBSD - Bug #3025] (New) sys/dev/powermng/powernow/powernow.c:284: bad comparison ?

bugtracker-admin at leaf.dragonflybsd.org bugtracker-admin at leaf.dragonflybsd.org
Tue Apr 11 12:01:04 PDT 2017


Issue #3025 has been reported by dcb.

----------------------------------------
Bug #3025: sys/dev/powermng/powernow/powernow.c:284: bad comparison ?
http://bugs.dragonflybsd.org/issues/3025

* Author: dcb
* Status: New
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
----------------------------------------
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.




-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account


More information about the Bugs mailing list