Project

General

Profile

Bug #3025 ยป 0001-Fix-powernow.c.patch

powernow.c patch - lubos, 09/23/2017 07:43 AM

View differences:

sys/dev/powermng/powernow/powernow.c
85 85
        do {                                                    \
86 86
                (status) = rdmsr(MSR_AMDK7_FIDVID_STATUS);      \
87 87
        } while (PN8_STA_PENDING(status))
88
#define abs(x) ( (x) < 0 ? -(x) : (x) )
88
#define diff(x, y) ((x) > (y) ? (x) - (y) : (y) - (x))
89 89

  
90 90
#define POWERNOW_MAX_STATES             16
91 91

  
......
281 281
		uint32_t	vco_fid, vco_cfid;
282 282
		vco_fid = FID_TO_VCO_FID(fid);
283 283
		vco_cfid = FID_TO_VCO_FID(cfid);
284
		while (abs(vco_fid - vco_cfid) > 2) {
284
		while (diff(vco_fid, vco_cfid) > 2) {
285 285
			if (fid > cfid) {
286 286
				if (cfid > 6)
287 287
					val = cfid + 2;
288
- 
    (1-1/1)