Kaben123 opened a new pull request, #21925:
URL: https://github.com/apache/nuttx/pull/21925

   ## Summary
   
   `crc16ibm()`/`crc16ibmpart()` (`lib_crc16ibm.c`) and
   `crc16h8005()`/`crc16h8005_part()` (`lib_crc16h8005.c`) implement the same
   CRC-16/ARC algorithm (poly 0x8005, reflected 0xA001, init 0, no final XOR).
   
   `lib_crc16ibm.c` is removed and `crc16ibm`/`crc16ibmpart` become macros in
   `include/nuttx/crc16.h` that map to the h8005 functions.
   
   ## Impact
   
   Source compatible: callers of `crc16ibm()`/`crc16ibmpart()` keep building
   and get identical results. The two symbols are no longer exported as real
   functions, so code that takes their address or declares them itself would 
need
   to use the h8005 names. There are no such users in nuttx or nuttx-apps.
   
   ## Testing
   
   Host: Ubuntu 22.04 x86_64, GCC 13.1.0. Base: apache/nuttx master 
5c1746778e8, apache/nuttx-apps master 7f4e5382d.
   
   - Compiled both upstream implementations on the host and compared them on
     2000 random buffers (0..256 bytes, random seed): 0 mismatches.
     `crc16ibm("123456789")` = 0xBB3D for both (the CRC-16/ARC check value).
   - `sim:nsh` builds with CMake and Make.
   - `tools/checkpatch.sh -c -u -m -g` passes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to