Coverity development validation - #12531
Conversation
3413363 3413606 3413645
3413259 3413306
| @@ -2408,7 +2407,6 @@ namespace librealsense | |||
| { | |||
| // D457 development - added for mipi device, for IR because no metadata there | |||
| return; | |||
There was a problem hiding this comment.
Hard to understand the comment here (repeating). Change to:
return; // Does not throw, MIPI device metadata not received through UVC, no metadata here may be valid
There was a problem hiding this comment.
The comments were updated in three places.
| return d.device_path; | ||
| for( auto & d : _group.usb_devices ) | ||
| return d.id; | ||
| if( _group.uvc_devices.size() ) |
There was a problem hiding this comment.
Style comment (you don't have to change if you prefer this style)
I think it is clearer to use if( ! _group.uvc_devices.empty() )
or at least if( _group.uvc_devices.size() > 0 )
There was a problem hiding this comment.
I also think that the approach is more elegant and readable.
| return d.id; | ||
| if( _group.uvc_devices.size() ) | ||
| return _group.uvc_devices.front().device_path; | ||
| if( _group.usb_devices.size() ) |
There was a problem hiding this comment.
What was the Coverity complaint here? I see nothing wrong with this code that I wrote :)
There was a problem hiding this comment.
CID 6053338 (#4 of 4): Structurally dead code (UNREACHABLE) unreachable: Since the loop increment ++<anonymous>; is unreachable, the loop body will never execute more than once.
I also think that your code is fine, but Tamir's change keeps the original logic and suppresses the warning.
If you have objections we can consider marking this issue as ignore. It will keep showing in the reports but will not count as a reason to fail the security SWRC
Tracked on [RSDEV-445]