Skip to content

Conversation

@kartben
Copy link
Contributor

@kartben kartben commented May 28, 2025

Removed a logically dead else by doing sensor channel check
in a way that's more aligned with how other drivers do it.

Fixes: CID 505949
Fixes: #90558

@kartben kartben added Coverity A Coverity detected issue or its fix Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc. labels May 28, 2025
@github-actions github-actions bot added the area: Sensors Sensors label May 28, 2025
Removed a logically dead else by doing sensor channel check
in a way that's more aligned with how other drivers do it.

Fixes: CID 505949
Fixes: zephyrproject-rtos#90558
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
@sonarqubecloud
Copy link

@nashif
Copy link
Member

nashif commented May 28, 2025

dead else

?

@kartben
Copy link
Contributor Author

kartben commented May 28, 2025

dead else

?

Had updated the commit message but not the PR message, sorry.
The last "else" was (rightfully) being flagged as being dead by coverity. I had initially removed it, but then Sonaqloud complained I had no default else 😄 so ended up going for the approach that most sensor drivers seem to follow.

@kartben kartben merged commit fdf713a into zephyrproject-rtos:main May 28, 2025
29 checks passed
@kartben kartben deleted the CID505949 branch October 22, 2025 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Sensors Sensors Coverity A Coverity detected issue or its fix Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Coverity CID: 505949] Logically dead code in drivers/sensor/tdk/icp101xx/icp101xx_drv.c

6 participants