mirror of
https://github.com/SCST-project/scst.git
synced 2026-10-22 14:12:33 +00:00
Replace SCN flag, iSNS header, list and CRC macros with typed inline helpers that evaluate their inputs once. Preserve SCN bit reversal and htonl(), header ntohs(), list mutation order and CRC arithmetic. The big-endian SCN helper returns its input. Decode only the header fields each handler consumes; retain full decoding for diagnostics and keep TLV bounds checks before reading SCN attributes. This also removes unused decoded fields and their unused attributes. Native Checkpatch reports MACRO_ARG_REUSE for SCN flags, iSNS header extraction, list initialization/removal and CRC byte updates: Macro argument reuse 'hdr' - possible side-effects? Macro argument reuse 'crc' - possible side-effects? It also reports MACRO_ARG_UNUSED for the big-endian SCN no-op macro. Checkpatch reports PREFER_DEFINED_ATTRIBUTE_MACRO: __always_unused or __maybe_unused is preferred over __attribute__((__unused__))