RDKEMW-22730 : Fix coverity issue on devicesettings - #268
Conversation
Reason for change: Fixing coverity reported issues. Test Procedure: Refer ticket. Risks: Low Priority: P2 version: minor Signed-off-by: balaji velmurugan <balaji_velmurugan@comcast.com>
There was a problem hiding this comment.
Pull request overview
This PR addresses Coverity-reported findings in the device settings audio components, aiming to remove redundant code and improve special-member-function completeness for a public type.
Changes:
- Removed a redundant assignment to
_DolbyVolumeModein an exception path (keeps the existing default behavior). - Added move operations to
AudioStereoModeto address a Coverity rule-of-five style warning.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| rpc/srv/dsAudio.c | Removes redundant assignment in nested exception handling during Dolby Volume mode initialization. |
| ds/include/audioStereoMode.hpp | Adds move constructor/assignment to AudioStereoMode (public API surface). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (1)
rpc/srv/dsAudio.c:1511
- The inner
catch(...)now silently swallows failures when both the persisted and defaultaudio.DolbyVolumeModelookups fail. That makes it hard to diagnose persistence/default-store issues, and the inline comment referencing a specific line number will become stale as the file changes. Consider logging the fallback-to-default behavior instead (while keeping the redundant assignment removed).
catch(...) {
//coverity fix: UNUSED_VALUE - removed redundant assignment, already initialized to "FALSE" at line 1498
}
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (1)
rpc/srv/dsAudio.c:1511
- The new INT_DEBUG line is indented with stray tabs/spaces, which is inconsistent with the surrounding block and can create noisy diffs or fail whitespace/style checks. Align it with the existing indentation in this function.
catch(...) {
INT_DEBUG("audio.DolbyVolumeMode system default not found. Using default: FALSE\n");
}
Merge pull request #277 from rdkcentral/develop
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (1)
rpc/srv/dsAudio.c:1506
bDolbyVolumeOverrideCheckis never set tofalseanymore (only initialized totrueand later set totrueagain), which makes the override logic ineffective and changes behavior: Volume Leveller initialization will now run even whenaudio.DolbyVolumeModeis present but Volume Leveller is not configured. This also makes the new log message misleading.
_DolbyVolumeMode = device::HostPersistence::getInstance().getProperty("audio.DolbyVolumeMode");
INT_DEBUG("audio.DolbyVolumeMode found in persistence: %s. bDolbyVolumeOverrideCheck will be set by VolumeLeveller check\n", _DolbyVolumeMode.c_str());
}
Reason for change: Fixing coverity reported issues.
Test Procedure: Refer ticket.
Risks: Low
Priority: P2
version: minor