]> git.baikalelectronics.ru Git - kernel.git/commit
iio: temperature: ltc2983: fix u32 read into a unsigned long long
authorColin Ian King <colin.king@canonical.com>
Tue, 5 Nov 2019 20:28:18 +0000 (20:28 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 8 Dec 2019 18:10:28 +0000 (18:10 +0000)
commit4005edce3a67f0dd51c9e23a353bf9f8016cee78
treeccfe5ba7dbe4154a86d6657ab900d04a237c531f
parentf4cfa33dd434e80b4aa5c84756166c92ee2501a2
iio: temperature: ltc2983: fix u32 read into a unsigned long long

Currently the read of temp using of_property_read_u32_index is reading
a u32 value into a unsigned long long.  This relies on machine endianness
to work correctly, so fix this by reading a u32 value and setting temp
to this value.

Addresses-Coverity: ("Reliance on integer endianness")
Fixes: e209923af97d ("iio: temperature: Add support for LTC2983")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/temperature/ltc2983.c