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:
parent
132d79615c
commit
2e7ec2bc29
1 changed files with 1 additions and 9 deletions
|
@ -365,15 +365,7 @@ static void adxl372_process_status1_cb(struct rtio *r, const struct rtio_sqe *sq
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum sensor_stream_data_opt data_opt;
|
enum sensor_stream_data_opt data_opt = MIN(fifo_wmark_cfg->opt, fifo_full_cfg->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);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data_opt == SENSOR_STREAM_DATA_NOP || data_opt == SENSOR_STREAM_DATA_DROP) {
|
if (data_opt == SENSOR_STREAM_DATA_NOP || data_opt == SENSOR_STREAM_DATA_DROP) {
|
||||||
uint8_t *buf;
|
uint8_t *buf;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue