summaryrefslogtreecommitdiffstats
path: root/meta/packages/hdparm/hdparm-6.3/bswap.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/hdparm/hdparm-6.3/bswap.patch')
-rw-r--r--meta/packages/hdparm/hdparm-6.3/bswap.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/meta/packages/hdparm/hdparm-6.3/bswap.patch b/meta/packages/hdparm/hdparm-6.3/bswap.patch
new file mode 100644
index 0000000000..37fbcb7b38
--- /dev/null
+++ b/meta/packages/hdparm/hdparm-6.3/bswap.patch
@@ -0,0 +1,36 @@
1
2#
3# Patch managed by http://www.holgerschurig.de/patcher.html
4#
5
6--- hdparm-5.8/hdparm.c~bswap
7+++ hdparm-5.8/hdparm.c
8@@ -20,7 +20,9 @@
9 #include <linux/types.h>
10 #include <linux/hdreg.h>
11 #include <linux/major.h>
12-#include <asm/byteorder.h>
13+#include <byteswap.h>
14+
15+#define le16_to_cpus(x) bswap_16(htons(x))
16
17 #include "hdparm.h"
18
19@@ -1160,7 +1162,7 @@
20 }
21 } else {
22 for(i = 0; i < 0x100; ++i) {
23- __le16_to_cpus(&id[i]);
24+ le16_to_cpus(&id[i]);
25 }
26 identify((void *)id, NULL);
27 }
28@@ -1380,7 +1382,7 @@
29 }
30 for (i = 0; count >= 4; ++i) {
31 sbuf[i] = (fromhex(b[0]) << 12) | (fromhex(b[1]) << 8) | (fromhex(b[2]) << 4) | fromhex(b[3]);
32- __le16_to_cpus((__u16 *)(&sbuf[i]));
33+ le16_to_cpus((__u16 *)(&sbuf[i]));
34 b += 5;
35 count -= 5;
36 }