From 4935e6c527143c892a4971adb2105013abe189b2 Mon Sep 17 00:00:00 2001 From: bluhm Date: Sun, 14 Jan 2018 00:33:09 +0000 Subject: [PATCH] Use signed values to compare absolute difference. The variables fid and cfid are signed, so the FID_TO_VCO_FID() macro creates signed results. Keep the sign when passing to abs() although the implicit conversions created the same binary. OK deraadt@ --- sys/arch/amd64/amd64/powernow-k8.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arch/amd64/amd64/powernow-k8.c b/sys/arch/amd64/amd64/powernow-k8.c index 0183c14c933..2f80234c00d 100644 --- a/sys/arch/amd64/amd64/powernow-k8.c +++ b/sys/arch/amd64/amd64/powernow-k8.c @@ -1,4 +1,4 @@ -/* $OpenBSD: powernow-k8.c,v 1.27 2017/12/09 16:39:54 fcambus Exp $ */ +/* $OpenBSD: powernow-k8.c,v 1.28 2018/01/14 00:33:09 bluhm Exp $ */ /* * Copyright (c) 2004 Martin VĂ©giard. * Copyright (c) 2004-2005 Bruno Ducrot @@ -231,7 +231,7 @@ k8pnow_transition(struct k8pnow_cpu_state *cstate, int level) /* Phase 2: change to requested core frequency */ if (cfid != fid) { - u_int vco_fid, vco_cfid; + int vco_fid, vco_cfid; vco_fid = FID_TO_VCO_FID(fid); vco_cfid = FID_TO_VCO_FID(cfid); -- 2.20.1