diff options
author | Stephan Gerhold <stephan@gerhold.net> | 2020-02-14 14:03:24 +0300 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2020-02-21 14:59:46 +0300 |
commit | b500c086e4110829a308c23e83a7cdc65b26228a (patch) | |
tree | c12f2396db9d0a7c13e7dfdd72ee545552a883d3 /tools/perf/scripts/python/stackcollapse.py | |
parent | 29e8c8253d7d5265f58122c0a7902e26df6c6f61 (diff) | |
download | linux-b500c086e4110829a308c23e83a7cdc65b26228a.tar.xz |
iio: magnetometer: ak8974: Fix negative raw values in sysfs
At the moment, reading from in_magn_*_raw in sysfs tends to return
large values around 65000, even though the output of ak8974 is actually
limited to ±32768. This happens because the value is never converted
to the signed 16-bit integer variant.
Add an explicit cast to s16 to fix this.
Fixes: 7c94a8b2ee8c ("iio: magn: add a driver for AK8974")
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Linus Waleij <linus.walleij@linaro.org>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions