]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
thermal/drivers/broadcom: Use clamp to simplify bcm2835_thermal_temp2adc
authorThorsten Blum <thorsten.blum@linux.dev>
Mon, 5 Jan 2026 12:13:03 +0000 (13:13 +0100)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Wed, 21 Jan 2026 16:04:41 +0000 (17:04 +0100)
commit68dabf4ebe0ec2f9a51d3fdc17b1ec64500b7ed4
treede2f154f111c2893ba2e351bd03f86581703c25f
parent8672be1c1aae98ca96e520bb71245228a1b65f8d
thermal/drivers/broadcom: Use clamp to simplify bcm2835_thermal_temp2adc

Use clamp() to simplify bcm2835_thermal_temp2adc() and improve its
readability. Explicitly cast BIT() to int to prevent a signedness error.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://patch.msgid.link/20260105121308.1761-1-thorsten.blum@linux.dev
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
drivers/thermal/broadcom/bcm2835_thermal.c