[SLOF] [PATCH 11/13] tools: removed a cpu_to_be64() in CRC calculation

Adrian Reber adrian at lisas.de
Wed Jun 15 18:29:58 AEST 2016


An unnecessary (and wrong) cpu_to_be64() in the CRC test
produced a CRC error during "-d". Removing it fixes it
on little and big endian.

(cherry picked from commit f2aa0523c887ce970284167d776975aa77401f14)

Cherry picked from https://lisas.de/~adrian/slof/slof.git/

Signed-off-by: Adrian Reber <adrian at lisas.de>
---
 tools/sloffs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/sloffs.c b/tools/sloffs.c
index b8faaae..b416b58 100644
--- a/tools/sloffs.c
+++ b/tools/sloffs.c
@@ -276,7 +276,7 @@ check_image_crc(const int fd, uint64_t len)
 		read_bytes += i;
 		if (read_bytes > len)
 			i -= read_bytes - len;
-		crc = calCRCword(buffer, i, cpu_to_be64(crc));
+		crc = calCRCword(buffer, i, crc);
 	}
 	return crc;
 }
-- 
2.7.4



More information about the SLOF mailing list