From: Michal Sojka Date: Wed, 6 Nov 2013 17:40:48 +0000 (+0100) Subject: CRC must be shifted before conversion to big endian, not after X-Git-Tag: fix-allnoconfig~125 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/can-benchmark.git/commitdiff_plain/d2073a52c1ba52749c1c9522c42ccbfc83b70b1d CRC must be shifted before conversion to big endian, not after --- diff --git a/latester/latester.c b/latester/latester.c index e19064a..b0937ba 100644 --- a/latester/latester.c +++ b/latester/latester.c @@ -204,7 +204,7 @@ uint32_t calc_bitmap_crc(uint32_t *bitmap, unsigned start, unsigned end) crc = crc_update(crc, bitmap[1], 32); crc = crc_update(crc, bitmap[2], end - 64 > 32 ? 32 : end - 64); crc = crc_update(crc, bitmap[3], end > 96 ? end - 96 : 0); - return (uint32_t)htons(crc) << 17; + return (uint32_t)htons(crc << 17); } void write_crc_to_bitmap(uint32_t crc, uint32_t *bitmap, struct can_frame *frame)