From d839dfb7516dcc88f3766b3af572d52b04d8bc5c Mon Sep 17 00:00:00 2001 From: rbuj Date: Thu, 5 Sep 2019 19:48:03 +0200 Subject: =?UTF-8?q?cpufreq:=20remove=20-Wabsolute-value=20warning=20cpufre?= =?UTF-8?q?q-selector-sysfs.c:244:18:=20warning:=20taking=20the=20absolute?= =?UTF-8?q?=20value=20of=20unsigned=20type=20=E2=80=98guint=E2=80=99=20{ak?= =?UTF-8?q?a=20=E2=80=98unsigned=20int=E2=80=99}=20has=20no=20effect=20[-W?= =?UTF-8?q?absolute-value]=20=20=20244=20|=20=20=20current=5Fdist=20=3D=20?= =?UTF-8?q?abs=20(frequency=20-=20f);=20=20=20=20=20=20=20|=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20^~~=20--=20cpufreq-selec?= =?UTF-8?q?tor-procfs.c:187:7:=20warning:=20taking=20the=20absolute=20valu?= =?UTF-8?q?e=20of=20unsigned=20type=20=E2=80=98guint=E2=80=99=20{aka=20?= =?UTF-8?q?=E2=80=98unsigned=20int=E2=80=99}=20has=20no=20effect=20[-Wabso?= =?UTF-8?q?lute-value]=20=20=20187=20|=20=20=20if=20(abs=20(sc=5Fmax=20-?= =?UTF-8?q?=20frequency)=20<=20abs=20(frequency=20-=20sc=5Fmin))=20=20=20?= =?UTF-8?q?=20=20=20=20|=20=20=20=20=20=20=20^~~=20cpufreq-selector-procfs?= =?UTF-8?q?.c:187:34:=20warning:=20taking=20the=20absolute=20value=20of=20?= =?UTF-8?q?unsigned=20type=20=E2=80=98guint=E2=80=99=20{aka=20=E2=80=98uns?= =?UTF-8?q?igned=20int=E2=80=99}=20has=20no=20effect=20[-Wabsolute-value]?= =?UTF-8?q?=20=20=20187=20|=20=20=20if=20(abs=20(sc=5Fmax=20-=20frequency)?= =?UTF-8?q?=20<=20abs=20(frequency=20-=20sc=5Fmin))=20=20=20=20=20=20=20|?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20^~~=20--=20cpufreq-selec?= =?UTF-8?q?tor-libcpufreq.c:109:18:=20warning:=20taking=20the=20absolute?= =?UTF-8?q?=20value=20of=20unsigned=20type=20=E2=80=98long=20unsigned=20in?= =?UTF-8?q?t=E2=80=99=20has=20no=20effect=20[-Wabsolute-value]=20=20=20109?= =?UTF-8?q?=20|=20=20=20current=5Fdist=20=3D=20abs=20(freq->frequency=20-?= =?UTF-8?q?=20frequency);=20=20=20=20=20=20=20|=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20^~~?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cpufreq/src/cpufreq-selector/cpufreq-selector-libcpufreq.c | 2 +- cpufreq/src/cpufreq-selector/cpufreq-selector-procfs.c | 2 +- cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'cpufreq') diff --git a/cpufreq/src/cpufreq-selector/cpufreq-selector-libcpufreq.c b/cpufreq/src/cpufreq-selector/cpufreq-selector-libcpufreq.c index d2fda2bf..d56364b5 100644 --- a/cpufreq/src/cpufreq-selector/cpufreq-selector-libcpufreq.c +++ b/cpufreq/src/cpufreq-selector/cpufreq-selector-libcpufreq.c @@ -106,7 +106,7 @@ cpufreq_selector_libcpufreq_get_valid_frequency (CPUFreqSelectorLibcpufreq *sele return frequency; } - current_dist = abs (freq->frequency - frequency); + current_dist = abs ((int)freq->frequency - (int)frequency); if (current_dist < dist) { dist = current_dist; retval = freq->frequency; diff --git a/cpufreq/src/cpufreq-selector/cpufreq-selector-procfs.c b/cpufreq/src/cpufreq-selector/cpufreq-selector-procfs.c index 3ee43c47..69ecaf77 100644 --- a/cpufreq/src/cpufreq-selector/cpufreq-selector-procfs.c +++ b/cpufreq/src/cpufreq-selector/cpufreq-selector-procfs.c @@ -184,7 +184,7 @@ cpufreq_selector_procfs_set_frequency (CPUFreqSelector *selector, } if (frequency != sc_max && frequency != sc_min) { - if (abs (sc_max - frequency) < abs (frequency - sc_min)) + if (abs ((int)sc_max - (int)frequency) < abs ((int)frequency - (int)sc_min)) freq = sc_max; else freq = sc_min; diff --git a/cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c b/cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c index 1cb87660..c1b0850c 100644 --- a/cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c +++ b/cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c @@ -241,7 +241,7 @@ cpufreq_selector_sysfs_get_valid_frequency (CPUFreqSelectorSysfs *selector, if (f == frequency) return freq; - current_dist = abs (frequency - f); + current_dist = abs ((int)frequency - (int)f); if (current_dist < dist) { dist = current_dist; retval = freq; -- cgit v1.2.1