upgrade to a more recent version of mtd-utils - preparation for adding UBI support
[openwrt/svn-archive/archive.git] / tools / mtd-utils / patches / 110-portability.patch
1 --- a/compr_lzo.c
2 +++ b/compr_lzo.c
3 @@ -24,7 +24,6 @@
4 #include <stdint.h>
5 #include <stdio.h>
6 #include <string.h>
7 -#include <asm/types.h>
8 #include <linux/jffs2.h>
9 #include <lzo/lzo1x.h>
10 #include "compr.h"
11 --- a/compr_zlib.c
12 +++ b/compr_zlib.c
13 @@ -35,7 +35,6 @@
14 #include <stdint.h>
15 #include <zlib.h>
16 #include <stdio.h>
17 -#include <asm/types.h>
18 #include <linux/jffs2.h>
19 #include "compr.h"
20
21 --- a/mkfs.jffs2.c
22 +++ b/mkfs.jffs2.c
23 @@ -1100,6 +1100,7 @@ static struct {
24 { 0, NULL, 0 }
25 };
26
27 +#ifndef NO_ACL_SUPPORT
28 static void formalize_posix_acl(void *xvalue, int *value_len)
29 {
30 struct posix_acl_xattr_header *pacl_header;
31 @@ -1151,6 +1152,7 @@ static void formalize_posix_acl(void *xv
32 memcpy(xvalue, buffer, offset);
33 *value_len = offset;
34 }
35 +#endif
36
37 static xattr_entry_t *create_xattr_entry(int xprefix, char *xname, char *xvalue, int value_len)
38 {
39 @@ -1205,9 +1207,11 @@ static xattr_entry_t *find_xattr_entry(i
40 if (!xentry_hash)
41 xentry_hash = xcalloc(1, sizeof(xe) * XATTRENTRY_HASHSIZE);
42
43 +#ifndef NO_ACL_SUPPORT
44 if (xprefix == JFFS2_XPREFIX_ACL_ACCESS
45 || xprefix == JFFS2_XPREFIX_ACL_DEFAULT)
46 formalize_posix_acl(xvalue, &value_len);
47 +#endif
48
49 name_len = strlen(xname);
50 index = (crc32(0, xname, name_len) ^ crc32(0, xvalue, value_len)) % XATTRENTRY_HASHSIZE;
51 --- a/rbtree.h
52 +++ b/rbtree.h
53 @@ -94,8 +94,7 @@ static inline struct page * rb_insert_pa
54 #ifndef _LINUX_RBTREE_H
55 #define _LINUX_RBTREE_H
56
57 -#include <linux/kernel.h>
58 -#include <linux/stddef.h>
59 +#include <stddef.h>
60
61 struct rb_node
62 {
63 @@ -131,7 +130,9 @@ static inline void rb_set_color(struct r
64
65 #define RB_ROOT (struct rb_root) { NULL, }
66
67 +#ifndef offsetof
68 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
69 +#endif
70
71 #define container_of(ptr, type, member) ({ \
72 const typeof( ((type *)0)->member ) *__mptr = (ptr); \