提交 bd4cfb59 编写于 作者: N Nicolas Kaiser 提交者: David S. Miller

[NETFILTER]: Remove ARRAY_SIZE duplicate

Signed-off-by: NNicolas Kaiser <nikai@nikai.net>
Signed-off-by: NHarald Welte <laforge@netfilter.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 2b8f2ff6
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
#define IPT_SCTP_VALID_FLAGS 0x07 #define IPT_SCTP_VALID_FLAGS 0x07
#define ELEMCOUNT(x) (sizeof(x)/sizeof(x[0]))
struct ipt_sctp_flag_info { struct ipt_sctp_flag_info {
u_int8_t chunktype; u_int8_t chunktype;
...@@ -59,21 +57,21 @@ struct ipt_sctp_info { ...@@ -59,21 +57,21 @@ struct ipt_sctp_info {
#define SCTP_CHUNKMAP_RESET(chunkmap) \ #define SCTP_CHUNKMAP_RESET(chunkmap) \
do { \ do { \
int i; \ int i; \
for (i = 0; i < ELEMCOUNT(chunkmap); i++) \ for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \
chunkmap[i] = 0; \ chunkmap[i] = 0; \
} while (0) } while (0)
#define SCTP_CHUNKMAP_SET_ALL(chunkmap) \ #define SCTP_CHUNKMAP_SET_ALL(chunkmap) \
do { \ do { \
int i; \ int i; \
for (i = 0; i < ELEMCOUNT(chunkmap); i++) \ for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \
chunkmap[i] = ~0; \ chunkmap[i] = ~0; \
} while (0) } while (0)
#define SCTP_CHUNKMAP_COPY(destmap, srcmap) \ #define SCTP_CHUNKMAP_COPY(destmap, srcmap) \
do { \ do { \
int i; \ int i; \
for (i = 0; i < ELEMCOUNT(chunkmap); i++) \ for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \
destmap[i] = srcmap[i]; \ destmap[i] = srcmap[i]; \
} while (0) } while (0)
...@@ -81,7 +79,7 @@ struct ipt_sctp_info { ...@@ -81,7 +79,7 @@ struct ipt_sctp_info {
({ \ ({ \
int i; \ int i; \
int flag = 1; \ int flag = 1; \
for (i = 0; i < ELEMCOUNT(chunkmap); i++) { \ for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \
if (chunkmap[i]) { \ if (chunkmap[i]) { \
flag = 0; \ flag = 0; \
break; \ break; \
...@@ -94,7 +92,7 @@ struct ipt_sctp_info { ...@@ -94,7 +92,7 @@ struct ipt_sctp_info {
({ \ ({ \
int i; \ int i; \
int flag = 1; \ int flag = 1; \
for (i = 0; i < ELEMCOUNT(chunkmap); i++) { \ for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \
if (chunkmap[i] != ~0) { \ if (chunkmap[i] != ~0) { \
flag = 0; \ flag = 0; \
break; \ break; \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册