OSDN Git Service

thermal/drivers/hisi: Simplify the temperature/step computation
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Thu, 19 Oct 2017 17:05:46 +0000 (19:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Dec 2017 13:26:31 +0000 (14:26 +0100)
commit02c17c0f825c2d22de05c18e97982796b634eff3
treeb0caba01dcfedf8124deaa70014596affd9083b2
parentcf826c57785384341c3f0cf2cfbfe86c02eb6b9b
thermal/drivers/hisi: Simplify the temperature/step computation

commit 48880b979cdc9ef5a70af020f42b8ba1e51dbd34 upstream.

The step and the base temperature are fixed values, we can simplify the
computation by converting the base temperature to milli celsius and use a
pre-computed step value. That saves us a lot of mult + div for nothing at
runtime.

Take also the opportunity to change the function names to be consistent with
the rest of the code.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Leo Yan <leo.yan@linaro.org>
Tested-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Kevin Wangtao <kevin.wangtao@hisilicon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/thermal/hisi_thermal.c