[NETFILTER]: Remove ARRAY_SIZE duplicate
authorNicolas Kaiser <nikai@nikai.net>
Mon, 21 Nov 2005 05:11:31 +0000 (21:11 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 21 Nov 2005 05:11:31 +0000 (21:11 -0800)
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>
include/linux/netfilter_ipv4/ipt_sctp.h

index e93a9ec99fc288cd919b32684aff054f2aceeb37..80b3dbacd193ea6ad6c6ce82a94b68d36a1aed78 100644 (file)
@@ -7,8 +7,6 @@
 
 #define IPT_SCTP_VALID_FLAGS           0x07
 
-#define ELEMCOUNT(x) (sizeof(x)/sizeof(x[0]))
-
 
 struct ipt_sctp_flag_info {
        u_int8_t chunktype;
@@ -59,21 +57,21 @@ struct ipt_sctp_info {
 #define SCTP_CHUNKMAP_RESET(chunkmap)                          \
        do {                                                    \
                int i;                                          \
-               for (i = 0; i < ELEMCOUNT(chunkmap); i++)       \
+               for (i = 0; i < ARRAY_SIZE(chunkmap); i++)      \
                        chunkmap[i] = 0;                        \
        } while (0)
 
 #define SCTP_CHUNKMAP_SET_ALL(chunkmap)                        \
        do {                                                    \
                int i;                                          \
-               for (i = 0; i < ELEMCOUNT(chunkmap); i++)       \
+               for (i = 0; i < ARRAY_SIZE(chunkmap); i++)      \
                        chunkmap[i] = ~0;                       \
        } while (0)
 
 #define SCTP_CHUNKMAP_COPY(destmap, srcmap)                    \
        do {                                                    \
                int i;                                          \
-               for (i = 0; i < ELEMCOUNT(chunkmap); i++)       \
+               for (i = 0; i < ARRAY_SIZE(chunkmap); i++)      \
                        destmap[i] = srcmap[i];                 \
        } while (0)
 
@@ -81,7 +79,7 @@ struct ipt_sctp_info {
 ({                                                     \
        int i;                                          \
        int flag = 1;                                   \
-       for (i = 0; i < ELEMCOUNT(chunkmap); i++) {     \
+       for (i = 0; i < ARRAY_SIZE(chunkmap); i++) {    \
                if (chunkmap[i]) {                      \
                        flag = 0;                       \
                        break;                          \
@@ -94,7 +92,7 @@ struct ipt_sctp_info {
 ({                                                     \
        int i;                                          \
        int flag = 1;                                   \
-       for (i = 0; i < ELEMCOUNT(chunkmap); i++) {     \
+       for (i = 0; i < ARRAY_SIZE(chunkmap); i++) {    \
                if (chunkmap[i] != ~0) {                \
                        flag = 0;                       \
                                break;                  \