mirror of
https://github.com/SCST-project/scst.git
synced 2026-10-22 06:02:33 +00:00
Remove overwritten initial values, unused offsets and zero-bit flag
operands. Derive the saved sense length from its captured value and rely
on C zero initialization for static-duration userspace objects. The FC
copy path remains unconditional because its buffers outlive the request.
Select CRC availability with the same four CONFIG predicates and use
else for a negative SRP residual only inside the nonzero-residual branch.
Group ternary bit tests and trim the PR filename's newline with strchr(),
retaining the empty-filename fallback. Manual review also identified the
overwritten QLogic tag initializer; every allocator branch assigns it.
Cppcheck reports:
redundantAssignment: Variable 'tp' is reassigned a value before the
old one has been used.
unreadVariable: Variable 'sg_cnt' is assigned a value that is never used.
unreadVariable: Variable 'data_offset' is assigned a value that is
never used.
clarifyCalculation: Clarify calculation precedence for '&' and '?'.
ignoredReturnValue: Return value of function strsep() is not used.
knownConditionTrueFalse: Condition '!crc32c' is always false.
knownConditionTrueFalse: Condition 'resid<0' is always true.
badBitmaskCheck: Operator '|' with one operand equal to zero is redundant.
It also marks the initial rc value in dev_user_process_cleanup() unread.
Checkpatch reports GLOBAL_INITIALISERS:
do not initialise globals to false