Use direct pointer truth tests, put scalar constants on the right and
remove redundant parentheses from conditions and address expressions.
Preserve required precedence, dereferenced-pointer semantics and
short-circuit evaluation. Keep preprocessor expressions and disabled
debug alternatives intact.
Use __func__ for unchanged parameter-error diagnostics and correct the
byte-order diagnostic spelling.
Source review also identified eight negated negative-index tests in
the daemon's parameter lookup chains. Use explicit >= 0 comparisons
while retaining assignment order and short-circuit evaluation. This
readability cleanup does not remove assignment-in-condition findings.
Checkpatch reports COMPARISON_TO_NULL:
Comparison to NULL could be written "target"
Checkpatch reports UNNECESSARY_PARENTHESES:
Unnecessary parentheses around tlv->value
Checkpatch reports CONSTANT_COMPARISON, COMPARISON_TO_NULL. One example:
Comparisons should place the constant on the right side of the test
Checkpatch reports CONSTANT_COMPARISON, EMBEDDED_FUNCTION_NAME,
TYPO_SPELLING. One example:
Comparisons should place the constant on the right side of the test
Use distinct names for parser arguments, local descriptors, trace flags
and iSNS send/receive transaction IDs. Rename the process-wide SRPT RDMA
listener so connection-specific IDs do not shadow it.
Remove initial values replaced unconditionally before use and the
impossible fgets NULL branch. Retain configuration-dependent
initializers, listener lifetime and every connection ID passed to RDMA
operations.
Cppcheck reports shadowArgument, redundantInitialization. One example:
Local variable 'pp' shadows outer argument
Cppcheck reports shadowVariable, unreadVariable. One example:
Argument 'trace_flag' shadows outer variable
Coccinelle misc/cond_no_effect.cocci reports:
usr/include/debug.c:121:1-3:
WARNING: possible condition with no effect (if == else)
Buffer tracing prints the same final line whether or not a full row has
already been printed. Remove that conditional and its unused j state.
Also remove the identical immediate/non-immediate branches in fileio
cache synchronization. Both branches already call exec_fsync, so retain
that call and the TODO for future background execution. This second
cleanup was found while reviewing the same pattern; it is not a separate
finding in the current report.
The trace output and synchronous cache-flush behavior are unchanged.