drivers: sensor: adi: adxl372: Remove logically dead code

Remove logically dead if and else-if conditions as shown by the static
analysis, replacing with the else statement.

When data_opt is assigned to the MIN of fifo_wmark_cfg and fifo_full_cfg,
both those variables will be non-NULL as an earlier condition ensures the
function returns if either one of the variables is NULL before assigning
to data_opt.

Signed-off-by: Alexander Apostolu <apostolu240@gmail.com>
This commit is contained in:
Alexander Apostolu 2025-06-02 13:02:00 -04:00 committed by Benjamin Cabé
commit 2e7ec2bc29

View file

@ -365,15 +365,7 @@ static void adxl372_process_status1_cb(struct rtio *r, const struct rtio_sqe *sq
return;
}
enum sensor_stream_data_opt data_opt;
if ((fifo_wmark_cfg != NULL) && (fifo_full_cfg == NULL)) {
data_opt = fifo_wmark_cfg->opt;
} else if ((fifo_wmark_cfg == NULL) && (fifo_full_cfg != NULL)) {
data_opt = fifo_full_cfg->opt;
} else {
data_opt = MIN(fifo_wmark_cfg->opt, fifo_full_cfg->opt);
}
enum sensor_stream_data_opt data_opt = MIN(fifo_wmark_cfg->opt, fifo_full_cfg->opt);
if (data_opt == SENSOR_STREAM_DATA_NOP || data_opt == SENSOR_STREAM_DATA_DROP) {
uint8_t *buf;