Skip to content

Commit 2e7ec2b

Browse files
alexapostolukartben
authored andcommitted
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>
1 parent 132d796 commit 2e7ec2b

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

drivers/sensor/adi/adxl372/adxl372_stream.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -365,15 +365,7 @@ static void adxl372_process_status1_cb(struct rtio *r, const struct rtio_sqe *sq
365365
return;
366366
}
367367

368-
enum sensor_stream_data_opt data_opt;
369-
370-
if ((fifo_wmark_cfg != NULL) && (fifo_full_cfg == NULL)) {
371-
data_opt = fifo_wmark_cfg->opt;
372-
} else if ((fifo_wmark_cfg == NULL) && (fifo_full_cfg != NULL)) {
373-
data_opt = fifo_full_cfg->opt;
374-
} else {
375-
data_opt = MIN(fifo_wmark_cfg->opt, fifo_full_cfg->opt);
376-
}
368+
enum sensor_stream_data_opt data_opt = MIN(fifo_wmark_cfg->opt, fifo_full_cfg->opt);
377369

378370
if (data_opt == SENSOR_STREAM_DATA_NOP || data_opt == SENSOR_STREAM_DATA_DROP) {
379371
uint8_t *buf;

0 commit comments

Comments
 (0)