summaryrefslogtreecommitdiff
path: root/drivers/iio/adc
diff options
context:
space:
mode:
authorAnand Ashok Dumbre <anand.ashok.dumbre@xilinx.com>2020-10-05 08:05:16 -0700
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2020-10-10 17:52:34 +0100
commit0e7a3978a40b26b85820afe9e544f0032103f805 (patch)
tree92c23241fd78080c32b9620bbde231e2081d3a0c /drivers/iio/adc
parentc5bf4d645f2d5c4c216dd690c5237d778102c848 (diff)
iio: core: Fix IIO_VAL_FRACTIONAL calculation for negative values
Fixes IIO_VAL_FRACTIONAL for case when the result is negative and exponent is 0. example: if the result is -0.75, tmp0 will be 0 and tmp1 = 75 This causes the output to lose sign because of %d in snprintf which works for tmp0 <= -1. Reported-by: kernel test robot <lkp@intel.com> #error: uninitialized symbol tmp Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Anand Ashok Dumbre <anand.ashok.dumbre@xilinx.com> Link: https://lore.kernel.org/r/1601910316-24111-1-git-send-email-anand.ashok.dumbre@xilinx.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/adc')
0 files changed, 0 insertions, 0 deletions