Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
zephyrbot opened this issue May 25, 2021 · 0 comments · Fixed by #35638
Closed

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

zephyrbot opened this issue May 25, 2021 · 0 comments · Fixed by #35638
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug

Comments

@zephyrbot
Copy link
Collaborator

Static code scan issues found in file:

https:/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.

@zephyrbot zephyrbot added bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug labels May 25, 2021
@galak galak added the has-pr label May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants