android_kernel_oneplus_msm8998/drivers/iio
Nathan Chancellor 6d7b052d84 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-06-11 12:24:02 +02:00
..
accel io: accel: kxcjk1013: restore the range after resume. 2019-04-27 09:34:01 +02:00
adc iio: ad_sigma_delta: Properly handle SPI bus locking vs CS assertion 2019-06-11 12:24:02 +02:00
amplifiers spi: Updates for v4.4 2015-11-05 13:15:12 -08:00
buffer iio:buffer: make length types match kfifo types 2018-07-03 11:21:30 +02:00
chemical iio: chemical: vz89x hardware i2c workaround 2015-09-30 18:20:53 +01:00
common iio: common: ssp_sensors: Initialize calculated_time in ssp_common_process_data 2019-06-11 12:24:02 +02:00
dac iio: dac: ad7303: fix channel description 2017-05-25 14:30:10 +02:00
frequency iio: ad9523: Fix return value for ad952x_store() 2018-09-09 20:04:33 +02:00
gyro iio/gyro/bmg160: Use millidegrees for temperature scale 2019-04-27 09:34:01 +02:00
humidity iio: hudmidity: hdc100x: fix incorrect shifting and scaling 2016-07-27 09:47:36 -07:00
imu iio: adis_lib: Initialize trigger before requesting interrupt 2018-02-28 10:17:22 +01:00
light iio: light: fix improper return value 2017-11-30 08:37:27 +00:00
magnetometer iio: magnetometer: st_magn_spi: fix spi_device_id table 2018-04-13 19:50:21 +02:00
orientation iio: orientation: hid-sensor-rotation: Add PM function (fix non working driver) 2016-11-18 10:48:35 +01:00
potentiometer iio: mcp4531: Driver for Microchip digital potentiometers 2015-09-30 18:20:53 +01:00
pressure iio: st_pressure: st_accel: pass correct platform data to init 2018-03-28 18:40:12 +02:00
proximity iio: proximity: as3935: recalibrate RCO after resume 2017-06-26 07:13:09 +02:00
temperature Add tsys02d meas-spec driver support 2015-10-11 10:21:19 +01:00
trigger iio: trigger: free trigger resource correctly 2017-11-15 17:13:10 +01:00
iio_core.h iio: Move buffer registration to the core 2014-12-12 12:28:31 +00:00
iio_core_trigger.h
industrialio-buffer.c iio: buffer: check if a buffer has been set up when poll is called 2018-02-28 10:17:22 +01:00
industrialio-core.c iio: core: Return error for failed read_reg 2017-10-12 11:27:34 +02:00
industrialio-event.c iio: event: Remove negative error code from iio_event_poll 2015-08-12 19:26:39 +01:00
industrialio-trigger.c iio: Fix error handling in iio_trigger_attach_poll_func 2016-07-27 09:47:36 -07:00
industrialio-triggered-event.c iio: Support triggered events 2015-08-27 20:47:09 +01:00
inkern.c iio: inkern: fix a NULL dereference on error 2016-02-25 12:01:17 -08:00
Kconfig iio: mcp4531: Driver for Microchip digital potentiometers 2015-09-30 18:20:53 +01:00
Makefile iio: mcp4531: Driver for Microchip digital potentiometers 2015-09-30 18:20:53 +01:00