Skip to content

Conversation

@jyoung8607
Copy link
Collaborator

@jyoung8607 jyoung8607 commented Dec 10, 2025

GC condition check that never fails, correctly identified by an updated cppcheck (not a MISRA violation) in #2254.

/home/runner/work/panda/panda/board/drivers/usb.h:506:20: style: Condition 'resp_len!=-1' is always true [knownConditionTrueFalse]
      if (resp_len != -1) {
                   ^
/home/runner/work/panda/panda/board/drivers/usb.h:504:39: note: Calling function 'comms_control_handler' returns !<=-1
      resp_len = comms_control_handler(&control_req, response);
                                      ^
/home/runner/work/panda/panda/board/drivers/usb.h:506:20: note: Condition 'resp_len!=-1' is always true
      if (resp_len != -1) {

This check/case was added in #565, and is leftover after #1743.

@jyoung8607 jyoung8607 changed the title garbage collect dead code garbage collect always-true condition check Dec 10, 2025
@adeebshihadeh adeebshihadeh merged commit f373c69 into commaai:master Dec 10, 2025
5 checks passed
@jyoung8607 jyoung8607 deleted the gc-dead-kline-code branch December 10, 2025 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants