]> git.baikalelectronics.ru Git - kernel.git/commit
thermal: rcar_thermal: Clean up rcar_thermal_update_temp()
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Thu, 14 May 2020 15:25:05 +0000 (17:25 +0200)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Fri, 22 May 2020 19:09:59 +0000 (21:09 +0200)
commit2a257997657280fdb3205ade843aa5983307f9a0
treee6ec4ad011f9524cdc0f2cd4cc8e779bc4dccf7e
parent04e9e7439214c64bd0e38d447a90178d610c7d78
thermal: rcar_thermal: Clean up rcar_thermal_update_temp()

Moving the ctemp variable out of the private data structure made it
possible to clean up rcar_thermal_update_temp(). Initialize the local
ctemp to the error code to return if the reading fails and just return
it at the end of the function.

It's OK to change the datatype of old, new and ctemp to int as all
values are ANDed with CTEMP (0x3f) before being stored. While at it
change the datatype of the loop variable 'i' to to unsigned int.

Suggested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20200514152505.1927634-1-niklas.soderlund+renesas@ragnatech.se
drivers/thermal/rcar_thermal.c