From f426116a77eb11c36ff6855e71ac94e9282024ef Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sat, 30 May 2026 21:54:12 +1000 Subject: [PATCH] AP_InertialSensor: ADIS16607: drop dead store when draining FIFO When discarding the rest of a FIFO block the read of REG_FIFO_DATA is only needed for its side effect (advancing the FIFO); the stored value was never used. Call it via UNUSED_RESULT() to make discarding the result explicit. Co-Authored-By: Claude Opus 4.8 --- libraries/AP_InertialSensor/AP_InertialSensor_ADIS16607.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_ADIS16607.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_ADIS16607.cpp index f94010de78e..4e0a95176f2 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_ADIS16607.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_ADIS16607.cpp @@ -392,9 +392,9 @@ void AP_InertialSensor_ADIS16607::read_sensor_fifo(void) } else if (ch == ADIS16607_FIFO_CHANNEL_MAX_INDEX) { need_sync = false; } else { - // Read to end of FIFO block + // Read to end of FIFO block (data discarded; the read advances the FIFO) while (fifo_word_num != 0) { - val = read_reg16(REG_FIFO_DATA); + UNUSED_RESULT(read_reg16(REG_FIFO_DATA)); ch = read_reg16(REG_FIFO_CH_INDEX); fifo_word_num--; if (ch == ADIS16607_FIFO_CHANNEL_MAX_INDEX) {