From 2e7ec2bc29d600702bee14800b8743692a76e006 Mon Sep 17 00:00:00 2001 From: Alexander Apostolu Date: Mon, 2 Jun 2025 13:02:00 -0400 Subject: [PATCH] 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 --- drivers/sensor/adi/adxl372/adxl372_stream.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/sensor/adi/adxl372/adxl372_stream.c b/drivers/sensor/adi/adxl372/adxl372_stream.c index 474c2da082f..4d42380ceb1 100644 --- a/drivers/sensor/adi/adxl372/adxl372_stream.c +++ b/drivers/sensor/adi/adxl372/adxl372_stream.c @@ -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;