drivers/pwm: Fix abs() usage in xec driver

Seems to be fine to temporarly cast to int there as frequencies are in
Mhz and not Ghz.

Fixes #20497
Coverity CID: 205638

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2019-12-03 11:41:16 +01:00 committed by Anas Nashif
commit c9e0876421

View file

@ -216,7 +216,8 @@ static struct xec_params *xec_compare_params(u32_t target_freq,
lc_params->off);
}
if (abs(target_freq - freq_h) < abs(target_freq - freq_l)) {
if (abs((int)target_freq - (int)freq_h) <
abs((int)target_freq - (int)freq_l)) {
params = hc_params;
} else {
params = lc_params;