Skip to contentSkip to conversation

NetStar: make crcit utility more readable.

PATCH New Ladislav Michl 2 participants 2 messages Dec 30, 2009 – Jan 26, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NetStar: make crcit utility more readable.

---
 board/netstar/crcit.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
board/netstar/crcit.c +5 -4
index e0cea9b..0eef41a 100644
@@ -56,13 +56,14 @@ static int do_crc(char *path, unsigned version)
 		fprintf(stderr, "File too large\n");
 		return EXIT_FAILURE;
 	}
-	size = (size + 3) & ~3;	/* round up to 4 bytes */
-	data[0] = size + 4;	/* add size of version field */
+	size  = (size + 3) & ~3;	/* round up to 4 bytes */
+	size += 4;			/* add size of version field */
+	data[0] = size;
 	data[1] = version;
-	data[2 + (size >> 2)] = crc32(0, (unsigned char *)(data + 1), data[0]);
+	data[size/4 + 1] = crc32(0, (unsigned char *)(data + 1), size);
 	close(fd);
 
-	if (write(STDOUT_FILENO, data, size + 3*4) == -1) {
+	if (write(STDOUT_FILENO, data, size + 4 /*size*/ + 4 /*crc*/) == -1) {
 		perror("Error writing file");
 		return EXIT_FAILURE;
 	}
Signature · 1 line
1.5.3.8
#1 lore raw

PATCH 1/1 NetStar: make crcit utility more readable.

Quoted 10 lines

Subject: [PATCH] NetStar: make crcit utility more readable.

---
 board/netstar/crcit.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

Pushed to u-boot-ti.

Again , since there is no patch description, I copied the patch header.