]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/hdparm/hdparm-6.3/bswap.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / hdparm / hdparm-6.3 / bswap.patch
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         }