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 <noreply@anthropic.com>
This commit is contained in:
Peter Barker
2026-07-30 23:50:11 +10:00
committed by Peter Barker
co-authored by Claude Opus 4.8
parent 8ca2d44597
commit f426116a77
@@ -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) {