summaryrefslogtreecommitdiff
path: root/target/linux/patches/3.4.106/mkpiggy.patch
blob: d4e815cd23b0e9a17053c45be783f53bc75279f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
diff -Nur linux-3.4.4.orig/arch/x86/boot/compressed/mkpiggy.c linux-3.4.4/arch/x86/boot/compressed/mkpiggy.c
--- linux-3.4.4.orig/arch/x86/boot/compressed/mkpiggy.c	2012-06-22 20:37:50.000000000 +0200
+++ linux-3.4.4/arch/x86/boot/compressed/mkpiggy.c	2012-07-03 09:48:02.000000000 +0200
@@ -29,7 +29,14 @@
 #include <stdio.h>
 #include <string.h>
 #include <inttypes.h>
-#include <tools/le_byteshift.h>
+
+static uint32_t getle32(const void *p)
+{
+	const uint8_t *cp = p;
+
+	return (uint32_t)cp[0] + ((uint32_t)cp[1] << 8) +
+		((uint32_t)cp[2] << 16) + ((uint32_t)cp[3] << 24);
+}
 
 int main(int argc, char *argv[])
 {
@@ -62,7 +69,7 @@
 	}
 
 	ilen = ftell(f);
-	olen = get_unaligned_le32(&olen);
+	olen = getle32(&olen);
 	fclose(f);
 
 	/*