]> asedeno.scripts.mit.edu Git - linux.git/commit
thermal: tsens: Fix negative temperature reporting
authorAmit Kucheria <amit.kucheria@linaro.org>
Thu, 26 Jul 2018 10:33:10 +0000 (16:03 +0530)
committerEduardo Valentin <edubezval@gmail.com>
Fri, 27 Jul 2018 22:16:55 +0000 (15:16 -0700)
commit432121adf5e880240237bd9b15ec0ab995d7ea1f
tree2a4115a3bd6ad2ffc9f810b88d09c3252ef323bd
parentfaa590baf8dfe5ad877e062f18de4419e4d174f7
thermal: tsens: Fix negative temperature reporting

The current code will always return 0xffffffff in case of negative
temperatures due to a bug in how the binary sign extension is being done.

Use sign_extend32() instead.

Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
drivers/thermal/qcom/tsens-v2.c