Skip to content

[Coverity CID: 236129] Unused value in drivers/adc/adc_lmp90xxx.c #35604

@zephyrbot

Description

@zephyrbot

Static code scan issues found in file:

https://github.com/zephyrproject-rtos/zephyr/tree/374629af906a24add294b1c3b945128cb6a486e8/drivers/adc/adc_lmp90xxx.c#L616

Category: Code maintainability issues
Function: lmp90xxx_adc_read_channel
Component: Drivers
CID: 236129

Details:

err = lmp90xxx_read_reg8(dev, LMP90XXX_REG_ADC_DONE,

610             delay = lmp90xxx_odr_delay_tbl[odr];
611             LOG_DBG("sleeping for %d ms", delay);
612             k_msleep(delay);
613    
614             /* Poll for data ready */
615             do {
>>>     CID 236129:  Code maintainability issues  (UNUSED_VALUE)
>>>     Assigning value from "lmp90xxx_read_reg8(dev, 24, &adc_done)" to "err" here, but that stored value is overwritten before it can be used.
616                 err = lmp90xxx_read_reg8(dev, LMP90XXX_REG_ADC_DONE,
617                             &adc_done);
618                 if (adc_done == 0xFFU) {
619                     LOG_DBG("sleeping for 1 ms");
620                     k_msleep(1);
621                 } else {

Please fix or provide comments in coverity using the link:

https://scan9.coverity.com/reports.htm#v29271/p12996

Note: This issue was created automatically. Priority was set based on classification
of the file affected and the impact field in coverity. Assignees were set using the CODEOWNERS file.

Metadata

Metadata

Assignees

Labels

CoverityA Coverity detected issue or its fixbugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions