1
0
Fork 0
alistair23-linux/drivers/iio/common/ssp_sensors
Nathan Chancellor 6f9ca1d3eb iio: common: ssp_sensors: Initialize calculated_time in ssp_common_process_data
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>
2019-04-04 20:19:56 +01:00
..
Kconfig
Makefile
ssp.h iio: common: ssp_sensors: account for const type of of_device_id.data 2018-01-08 16:03:43 +01:00
ssp_dev.c iio: ssp_sensors: don't manually free devm managed resources 2018-10-07 20:04:30 +01:00
ssp_iio.c iio: common: ssp_sensors: Initialize calculated_time in ssp_common_process_data 2019-04-04 20:19:56 +01:00
ssp_iio_sensor.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ssp_spi.c iio: common: ssp_sensors: use ktime_get_real_ns() timestamps 2018-01-08 16:03:41 +01:00