summaryrefslogtreecommitdiff
path: root/recipes/hdparm/hdparm-6.6/bswap.patch
blob: 6b0506ceb5eef9665fb21f3f4c3fcb79ec3b8285 (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
29
30
31
32
33
34
35
36
37

#
# Patch managed by http://www.holgerschurig.de/patcher.html
#

--- hdparm-5.8/hdparm.c~bswap
+++ hdparm-5.8/hdparm.c
@@ -20,8 +20,9 @@
 #include <linux/types.h>
 #include <linux/hdreg.h>
 #include <linux/major.h>
-#include <asm/byteorder.h>
-//#include <endian.h>
+#include <byteswap.h>
+
+#define le16_to_cpus(x) bswap_16(htons(x))
 
 #include "hdparm.h"
 
@@ -1160,7 +1162,7 @@
 			}
 		} else {
 			for(i = 0; i < 0x100; ++i) {
-				__le16_to_cpus(&id[i]);
+				le16_to_cpus(&id[i]);
 			}
 			identify((void *)id, NULL);
 		}
@@ -1380,7 +1382,7 @@
 	}
 	for (i = 0; count >= 4; ++i) {
 		sbuf[i] = (fromhex(b[0]) << 12) | (fromhex(b[1]) << 8) | (fromhex(b[2]) << 4) | fromhex(b[3]);
-		__le16_to_cpus((__u16 *)(&sbuf[i]));
+		le16_to_cpus((__u16 *)(&sbuf[i]));
 		b += 5;
 		count -= 5;
 	}