1 --- a/include/linux/netfilter/xt_sctp.h
2 +++ b/include/linux/netfilter/xt_sctp.h
5 #define SCTP_CHUNKMAP_SET(chunkmap, type) \
7 - (chunkmap)[type / bytes(u_int32_t)] |= \
8 + chunkmap[type / bytes(u_int32_t)] |= \
9 1 << (type % bytes(u_int32_t)); \
12 #define SCTP_CHUNKMAP_CLEAR(chunkmap, type) \
14 - (chunkmap)[type / bytes(u_int32_t)] &= \
15 + chunkmap[type / bytes(u_int32_t)] &= \
16 ~(1 << (type % bytes(u_int32_t))); \
19 #define SCTP_CHUNKMAP_IS_SET(chunkmap, type) \
21 - ((chunkmap)[type / bytes (u_int32_t)] & \
22 + (chunkmap[type / bytes (u_int32_t)] & \
23 (1 << (type % bytes (u_int32_t)))) ? 1: 0; \
26 -#define SCTP_CHUNKMAP_RESET(chunkmap) \
27 - memset((chunkmap), 0, sizeof(chunkmap))
28 +#define SCTP_CHUNKMAP_RESET(chunkmap) \
31 + for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \
35 -#define SCTP_CHUNKMAP_SET_ALL(chunkmap) \
36 - memset((chunkmap), ~0U, sizeof(chunkmap))
37 +#define SCTP_CHUNKMAP_SET_ALL(chunkmap) \
40 + for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \
44 -#define SCTP_CHUNKMAP_COPY(destmap, srcmap) \
45 - memcpy((destmap), (srcmap), sizeof(srcmap))
46 +#define SCTP_CHUNKMAP_COPY(destmap, srcmap) \
49 + for (i = 0; i < ARRAY_SIZE(srcmap); i++) \
50 + destmap[i] = srcmap[i]; \
53 +#define SCTP_CHUNKMAP_IS_CLEAR(chunkmap) \
57 + for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \
58 + if (chunkmap[i]) { \
66 -#define SCTP_CHUNKMAP_IS_CLEAR(chunkmap) \
67 - __sctp_chunkmap_is_clear((chunkmap), ARRAY_SIZE(chunkmap))
69 -__sctp_chunkmap_is_clear(const u_int32_t *chunkmap, unsigned int n)
72 - for (i = 0; i < n; ++i)
78 -#define SCTP_CHUNKMAP_IS_ALL_SET(chunkmap) \
79 - __sctp_chunkmap_is_all_set((chunkmap), ARRAY_SIZE(chunkmap))
81 -__sctp_chunkmap_is_all_set(const u_int32_t *chunkmap, unsigned int n)
84 - for (i = 0; i < n; ++i)
85 - if (chunkmap[i] != ~0U)
89 +#define SCTP_CHUNKMAP_IS_ALL_SET(chunkmap) \
93 + for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \
94 + if (chunkmap[i] != ~0) { \
102 #endif /* _XT_SCTP_H_ */