merge of '07a342693675fe2b1daacf0eb62302579d9fade3'
[org.openembedded.dev.git] / packages / hdparm / hdparm-6.6 / bswap.patch
blob6b0506ceb5eef9665fb21f3f4c3fcb79ec3b8285
3 # Patch managed by http://www.holgerschurig.de/patcher.html
6 --- hdparm-5.8/hdparm.c~bswap
7 +++ hdparm-5.8/hdparm.c
8 @@ -20,8 +20,9 @@
9 #include <linux/types.h>
10 #include <linux/hdreg.h>
11 #include <linux/major.h>
12 -#include <asm/byteorder.h>
13 -//#include <endian.h>
14 +#include <byteswap.h>
16 +#define le16_to_cpus(x) bswap_16(htons(x))
18 #include "hdparm.h"
20 @@ -1160,7 +1162,7 @@
22 } else {
23 for(i = 0; i < 0x100; ++i) {
24 - __le16_to_cpus(&id[i]);
25 + le16_to_cpus(&id[i]);
27 identify((void *)id, NULL);
29 @@ -1380,7 +1382,7 @@
31 for (i = 0; count >= 4; ++i) {
32 sbuf[i] = (fromhex(b[0]) << 12) | (fromhex(b[1]) << 8) | (fromhex(b[2]) << 4) | fromhex(b[3]);
33 - __le16_to_cpus((__u16 *)(&sbuf[i]));
34 + le16_to_cpus((__u16 *)(&sbuf[i]));
35 b += 5;
36 count -= 5;