From: Måns Rullgård Date: Mon, 28 Oct 2013 23:19:53 +0000 (+0000) Subject: ti814x: Fix illegal use of FP ops in clock_ti814x.c X-Git-Tag: v2014.04-rc2~72^2~5^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=11f296870659e1375e7116a859458b254cc3156f;p=u-boot ti814x: Fix illegal use of FP ops in clock_ti814x.c The function pll_sigma_delta_val uses "float" data which is not correct. The exact "why" of this mangling is lost to history, but this changes us to equivalent non-FP math to get the same results. Reported-by: Wolfgang Denk Acked-by: Matt Porter --- diff --git a/arch/arm/cpu/armv7/am33xx/clock_ti814x.c b/arch/arm/cpu/armv7/am33xx/clock_ti814x.c index ef14f47ebc..9b5a47b018 100644 --- a/arch/arm/cpu/armv7/am33xx/clock_ti814x.c +++ b/arch/arm/cpu/armv7/am33xx/clock_ti814x.c @@ -211,11 +211,8 @@ static u32 pll_dco_freq_sel(u32 clkout_dco) static u32 pll_sigma_delta_val(u32 clkout_dco) { u32 sig_val = 0; - float frac_div; - frac_div = (float) clkout_dco / 250; - frac_div = frac_div + 0.90; - sig_val = (int)frac_div; + sig_val = (clkout_dco + 225) / 250; sig_val = sig_val << 24; return sig_val;