android_kernel_sony_sdm845/drivers/iio/common
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nathan Chancellor b0ef67afb8 iio: common: ssp_sensors: Initialize calculated_time in ssp_common_process_data
[ Upstream commit 6f9ca1d3eb74b81f811a87002de2d51640d135b1 ]

When building with -Wsometimes-uninitialized, Clang warns:

drivers/iio/common/ssp_sensors/ssp_iio.c:95:6: warning: variable
'calculated_time' is used uninitialized whenever 'if' condition is false
[-Wsometimes-uninitialized]

While it isn't wrong, this will never be a problem because
iio_push_to_buffers_with_timestamp only uses calculated_time
on the same condition that it is assigned (when scan_timestamp
is not zero). While iio_push_to_buffers_with_timestamp is marked
as inline, Clang does inlining in the optimization stage, which
happens after the semantic analysis phase (plus inline is merely
a hint to the compiler).

Fix this by just zero initializing calculated_time.

Link: https://github.com/ClangBuiltLinux/linux/issues/394
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-05-31 06:48:27 -07:00
..
hid-sensors iio: hid-sensor: fix return of -EINVAL on invalid values in ret or value 2018-03-24 11:00:16 +01:00
ms_sensors iio: common: ms_sensors: use tab for indention 2016-04-16 13:39:25 +01:00
ssp_sensors iio: common: ssp_sensors: Initialize calculated_time in ssp_common_process_data 2019-05-31 06:48:27 -07:00
st_sensors iio: accel: st_accel: fix LIS3LV02 reading and scaling 2017-01-12 11:39:21 +01:00
Kconfig Add meas-spec sensors common part 2015-10-04 14:58:02 +01:00
Makefile Add meas-spec sensors common part 2015-10-04 14:58:02 +01:00