1
0
Fork 0
alistair23-linux/drivers/iio/common/hid-sensors
Andy Shevchenko f6897deef4 iio: hid-sensor-attributes: Fix divisions for 32-bit platforms
The commit 473d12f763

  ("iio: hid-sensor-attributes: Convert to use int_pow()")

converted to use generic int_pow() helper. Though, the generic one returns
64-bit value and, in cases when it is used as divisor, it compels 64-bit
division from compiler.

In order to fix this, introduce a temporary 32-bit variable to hold the result
of int_pow() and use it as divisor afterwards.

In couple of cases, replace int_pow() with a predefined unit factors for time
and frequency.

Fixes: 473d12f763 ("iio: hid-sensor-attributes: Convert to use int_pow()")
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://lore.kernel.org/r/20190905112759.13035-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-06 08:09:34 +02:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
hid-sensor-attributes.c iio: hid-sensor-attributes: Fix divisions for 32-bit platforms 2019-09-06 08:09:34 +02:00
hid-sensor-trigger.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 335 2019-06-05 17:37:06 +02:00
hid-sensor-trigger.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 335 2019-06-05 17:37:06 +02:00