diff options
author | Nicolas Kaiser <nikai@nikai.net> | 2005-11-21 00:11:31 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-11-21 00:11:31 -0500 |
commit | bd4cfb594bdea00c3920b31bd12f497fc4a2e79c (patch) | |
tree | 30d0ab6a23675dc3ab19e6b2e760c93ea3fe2d6d /include/linux | |
parent | 2b8f2ff6f4c11fff9c3016b54fa261f522a54b70 (diff) |
[NETFILTER]: Remove ARRAY_SIZE duplicate
Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/netfilter_ipv4/ipt_sctp.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/include/linux/netfilter_ipv4/ipt_sctp.h b/include/linux/netfilter_ipv4/ipt_sctp.h index e93a9ec99fc2..80b3dbacd193 100644 --- a/include/linux/netfilter_ipv4/ipt_sctp.h +++ b/include/linux/netfilter_ipv4/ipt_sctp.h | |||
@@ -7,8 +7,6 @@ | |||
7 | 7 | ||
8 | #define IPT_SCTP_VALID_FLAGS 0x07 | 8 | #define IPT_SCTP_VALID_FLAGS 0x07 |
9 | 9 | ||
10 | #define ELEMCOUNT(x) (sizeof(x)/sizeof(x[0])) | ||
11 | |||
12 | 10 | ||
13 | struct ipt_sctp_flag_info { | 11 | struct ipt_sctp_flag_info { |
14 | u_int8_t chunktype; | 12 | u_int8_t chunktype; |
@@ -59,21 +57,21 @@ struct ipt_sctp_info { | |||
59 | #define SCTP_CHUNKMAP_RESET(chunkmap) \ | 57 | #define SCTP_CHUNKMAP_RESET(chunkmap) \ |
60 | do { \ | 58 | do { \ |
61 | int i; \ | 59 | int i; \ |
62 | for (i = 0; i < ELEMCOUNT(chunkmap); i++) \ | 60 | for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \ |
63 | chunkmap[i] = 0; \ | 61 | chunkmap[i] = 0; \ |
64 | } while (0) | 62 | } while (0) |
65 | 63 | ||
66 | #define SCTP_CHUNKMAP_SET_ALL(chunkmap) \ | 64 | #define SCTP_CHUNKMAP_SET_ALL(chunkmap) \ |
67 | do { \ | 65 | do { \ |
68 | int i; \ | 66 | int i; \ |
69 | for (i = 0; i < ELEMCOUNT(chunkmap); i++) \ | 67 | for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \ |
70 | chunkmap[i] = ~0; \ | 68 | chunkmap[i] = ~0; \ |
71 | } while (0) | 69 | } while (0) |
72 | 70 | ||
73 | #define SCTP_CHUNKMAP_COPY(destmap, srcmap) \ | 71 | #define SCTP_CHUNKMAP_COPY(destmap, srcmap) \ |
74 | do { \ | 72 | do { \ |
75 | int i; \ | 73 | int i; \ |
76 | for (i = 0; i < ELEMCOUNT(chunkmap); i++) \ | 74 | for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \ |
77 | destmap[i] = srcmap[i]; \ | 75 | destmap[i] = srcmap[i]; \ |
78 | } while (0) | 76 | } while (0) |
79 | 77 | ||
@@ -81,7 +79,7 @@ struct ipt_sctp_info { | |||
81 | ({ \ | 79 | ({ \ |
82 | int i; \ | 80 | int i; \ |
83 | int flag = 1; \ | 81 | int flag = 1; \ |
84 | for (i = 0; i < ELEMCOUNT(chunkmap); i++) { \ | 82 | for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \ |
85 | if (chunkmap[i]) { \ | 83 | if (chunkmap[i]) { \ |
86 | flag = 0; \ | 84 | flag = 0; \ |
87 | break; \ | 85 | break; \ |
@@ -94,7 +92,7 @@ struct ipt_sctp_info { | |||
94 | ({ \ | 92 | ({ \ |
95 | int i; \ | 93 | int i; \ |
96 | int flag = 1; \ | 94 | int flag = 1; \ |
97 | for (i = 0; i < ELEMCOUNT(chunkmap); i++) { \ | 95 | for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \ |
98 | if (chunkmap[i] != ~0) { \ | 96 | if (chunkmap[i] != ~0) { \ |
99 | flag = 0; \ | 97 | flag = 0; \ |
100 | break; \ | 98 | break; \ |