diff options
author | Jan Engelhardt <jengelh@computergmbh.de> | 2007-12-18 01:44:06 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:59:08 -0500 |
commit | e79ec50b9587c175f65f98550d66ad5b96c05dd9 (patch) | |
tree | 9cefac924a8092a124b50fb2767927d3c92717c1 | |
parent | 643a2c15a407faf08101a20e1a3461160711899d (diff) |
[NETFILTER]: Parenthesize macro parameters
Parenthesize macro parameters.
Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv4/netfilter/arp_tables.c | 3 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_tables.c | 3 | ||||
-rw-r--r-- | net/ipv4/netfilter/nf_nat_snmp_basic.c | 2 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6_tables.c | 2 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_h323_asn1.c | 8 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_netlink.c | 2 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_proto_sctp.c | 8 | ||||
-rw-r--r-- | net/netfilter/xt_conntrack.c | 3 | ||||
-rw-r--r-- | net/netfilter/xt_policy.c | 2 | ||||
-rw-r--r-- | net/netfilter/xt_string.c | 2 |
10 files changed, 19 insertions, 16 deletions
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c index ad2da6db0e26..b4a810c28ac8 100644 --- a/net/ipv4/netfilter/arp_tables.c +++ b/net/ipv4/netfilter/arp_tables.c | |||
@@ -84,7 +84,7 @@ static inline int arp_packet_match(const struct arphdr *arphdr, | |||
84 | __be32 src_ipaddr, tgt_ipaddr; | 84 | __be32 src_ipaddr, tgt_ipaddr; |
85 | int i, ret; | 85 | int i, ret; |
86 | 86 | ||
87 | #define FWINV(bool,invflg) ((bool) ^ !!(arpinfo->invflags & invflg)) | 87 | #define FWINV(bool, invflg) ((bool) ^ !!(arpinfo->invflags & (invflg))) |
88 | 88 | ||
89 | if (FWINV((arphdr->ar_op & arpinfo->arpop_mask) != arpinfo->arpop, | 89 | if (FWINV((arphdr->ar_op & arpinfo->arpop_mask) != arpinfo->arpop, |
90 | ARPT_INV_ARPOP)) { | 90 | ARPT_INV_ARPOP)) { |
@@ -180,6 +180,7 @@ static inline int arp_packet_match(const struct arphdr *arphdr, | |||
180 | } | 180 | } |
181 | 181 | ||
182 | return 1; | 182 | return 1; |
183 | #undef FWINV | ||
183 | } | 184 | } |
184 | 185 | ||
185 | static inline int arp_checkentry(const struct arpt_arp *arp) | 186 | static inline int arp_checkentry(const struct arpt_arp *arp) |
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c index 271f6a5d3d4c..f5b66ec18b0d 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c | |||
@@ -85,7 +85,7 @@ ip_packet_match(const struct iphdr *ip, | |||
85 | size_t i; | 85 | size_t i; |
86 | unsigned long ret; | 86 | unsigned long ret; |
87 | 87 | ||
88 | #define FWINV(bool,invflg) ((bool) ^ !!(ipinfo->invflags & invflg)) | 88 | #define FWINV(bool, invflg) ((bool) ^ !!(ipinfo->invflags & (invflg))) |
89 | 89 | ||
90 | if (FWINV((ip->saddr&ipinfo->smsk.s_addr) != ipinfo->src.s_addr, | 90 | if (FWINV((ip->saddr&ipinfo->smsk.s_addr) != ipinfo->src.s_addr, |
91 | IPT_INV_SRCIP) | 91 | IPT_INV_SRCIP) |
@@ -216,6 +216,7 @@ unconditional(const struct ipt_ip *ip) | |||
216 | return 0; | 216 | return 0; |
217 | 217 | ||
218 | return 1; | 218 | return 1; |
219 | #undef FWINV | ||
219 | } | 220 | } |
220 | 221 | ||
221 | #if defined(CONFIG_NETFILTER_XT_TARGET_TRACE) || \ | 222 | #if defined(CONFIG_NETFILTER_XT_TARGET_TRACE) || \ |
diff --git a/net/ipv4/netfilter/nf_nat_snmp_basic.c b/net/ipv4/netfilter/nf_nat_snmp_basic.c index 03709d6b4b06..07f2a49926d4 100644 --- a/net/ipv4/netfilter/nf_nat_snmp_basic.c +++ b/net/ipv4/netfilter/nf_nat_snmp_basic.c | |||
@@ -60,7 +60,7 @@ MODULE_ALIAS("ip_nat_snmp_basic"); | |||
60 | 60 | ||
61 | #define SNMP_PORT 161 | 61 | #define SNMP_PORT 161 |
62 | #define SNMP_TRAP_PORT 162 | 62 | #define SNMP_TRAP_PORT 162 |
63 | #define NOCT1(n) (*(u8 *)n) | 63 | #define NOCT1(n) (*(u8 *)(n)) |
64 | 64 | ||
65 | static int debug; | 65 | static int debug; |
66 | static DEFINE_SPINLOCK(snmp_lock); | 66 | static DEFINE_SPINLOCK(snmp_lock); |
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index bb50d0e66734..4ed16d254b98 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c | |||
@@ -102,7 +102,7 @@ ip6_packet_match(const struct sk_buff *skb, | |||
102 | unsigned long ret; | 102 | unsigned long ret; |
103 | const struct ipv6hdr *ipv6 = ipv6_hdr(skb); | 103 | const struct ipv6hdr *ipv6 = ipv6_hdr(skb); |
104 | 104 | ||
105 | #define FWINV(bool,invflg) ((bool) ^ !!(ip6info->invflags & invflg)) | 105 | #define FWINV(bool, invflg) ((bool) ^ !!(ip6info->invflags & (invflg))) |
106 | 106 | ||
107 | if (FWINV(ipv6_masked_addr_cmp(&ipv6->saddr, &ip6info->smsk, | 107 | if (FWINV(ipv6_masked_addr_cmp(&ipv6->saddr, &ip6info->smsk, |
108 | &ip6info->src), IP6T_INV_SRCIP) | 108 | &ip6info->src), IP6T_INV_SRCIP) |
diff --git a/net/netfilter/nf_conntrack_h323_asn1.c b/net/netfilter/nf_conntrack_h323_asn1.c index a869403b2294..ff66fba514fd 100644 --- a/net/netfilter/nf_conntrack_h323_asn1.c +++ b/net/netfilter/nf_conntrack_h323_asn1.c | |||
@@ -100,10 +100,10 @@ typedef struct { | |||
100 | } bitstr_t; | 100 | } bitstr_t; |
101 | 101 | ||
102 | /* Tool Functions */ | 102 | /* Tool Functions */ |
103 | #define INC_BIT(bs) if((++bs->bit)>7){bs->cur++;bs->bit=0;} | 103 | #define INC_BIT(bs) if((++(bs)->bit)>7){(bs)->cur++;(bs)->bit=0;} |
104 | #define INC_BITS(bs,b) if((bs->bit+=b)>7){bs->cur+=bs->bit>>3;bs->bit&=7;} | 104 | #define INC_BITS(bs,b) if(((bs)->bit+=(b))>7){(bs)->cur+=(bs)->bit>>3;(bs)->bit&=7;} |
105 | #define BYTE_ALIGN(bs) if(bs->bit){bs->cur++;bs->bit=0;} | 105 | #define BYTE_ALIGN(bs) if((bs)->bit){(bs)->cur++;(bs)->bit=0;} |
106 | #define CHECK_BOUND(bs,n) if(bs->cur+(n)>bs->end)return(H323_ERROR_BOUND) | 106 | #define CHECK_BOUND(bs,n) if((bs)->cur+(n)>(bs)->end)return(H323_ERROR_BOUND) |
107 | static unsigned get_len(bitstr_t * bs); | 107 | static unsigned get_len(bitstr_t * bs); |
108 | static unsigned get_bit(bitstr_t * bs); | 108 | static unsigned get_bit(bitstr_t * bs); |
109 | static unsigned get_bits(bitstr_t * bs, unsigned b); | 109 | static unsigned get_bits(bitstr_t * bs, unsigned b); |
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index 3a065f43ddd8..d93d58d688b9 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c | |||
@@ -534,7 +534,7 @@ static int ctnetlink_done(struct netlink_callback *cb) | |||
534 | return 0; | 534 | return 0; |
535 | } | 535 | } |
536 | 536 | ||
537 | #define L3PROTO(ct) ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.l3num | 537 | #define L3PROTO(ct) (ct)->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.l3num |
538 | 538 | ||
539 | static int | 539 | static int |
540 | ctnetlink_dump_table(struct sk_buff *skb, struct netlink_callback *cb) | 540 | ctnetlink_dump_table(struct sk_buff *skb, struct netlink_callback *cb) |
diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c index 224612370f5b..9296fd281899 100644 --- a/net/netfilter/nf_conntrack_proto_sctp.c +++ b/net/netfilter/nf_conntrack_proto_sctp.c | |||
@@ -186,10 +186,10 @@ static int sctp_print_conntrack(struct seq_file *s, | |||
186 | } | 186 | } |
187 | 187 | ||
188 | #define for_each_sctp_chunk(skb, sch, _sch, offset, dataoff, count) \ | 188 | #define for_each_sctp_chunk(skb, sch, _sch, offset, dataoff, count) \ |
189 | for (offset = dataoff + sizeof(sctp_sctphdr_t), count = 0; \ | 189 | for ((offset) = (dataoff) + sizeof(sctp_sctphdr_t), (count) = 0; \ |
190 | offset < skb->len && \ | 190 | (offset) < (skb)->len && \ |
191 | (sch = skb_header_pointer(skb, offset, sizeof(_sch), &_sch)); \ | 191 | ((sch) = skb_header_pointer((skb), (offset), sizeof(_sch), &(_sch))); \ |
192 | offset += (ntohs(sch->length) + 3) & ~3, count++) | 192 | (offset) += (ntohs((sch)->length) + 3) & ~3, (count)++) |
193 | 193 | ||
194 | /* Some validity checks to make sure the chunks are fine */ | 194 | /* Some validity checks to make sure the chunks are fine */ |
195 | static int do_basic_checks(struct nf_conn *conntrack, | 195 | static int do_basic_checks(struct nf_conn *conntrack, |
diff --git a/net/netfilter/xt_conntrack.c b/net/netfilter/xt_conntrack.c index 8c1d448c973e..3f8bfbaa9b19 100644 --- a/net/netfilter/xt_conntrack.c +++ b/net/netfilter/xt_conntrack.c | |||
@@ -32,7 +32,7 @@ conntrack_mt(const struct sk_buff *skb, const struct net_device *in, | |||
32 | 32 | ||
33 | ct = nf_ct_get(skb, &ctinfo); | 33 | ct = nf_ct_get(skb, &ctinfo); |
34 | 34 | ||
35 | #define FWINV(bool,invflg) ((bool) ^ !!(sinfo->invflags & invflg)) | 35 | #define FWINV(bool, invflg) ((bool) ^ !!(sinfo->invflags & (invflg))) |
36 | 36 | ||
37 | if (ct == &nf_conntrack_untracked) | 37 | if (ct == &nf_conntrack_untracked) |
38 | statebit = XT_CONNTRACK_STATE_UNTRACKED; | 38 | statebit = XT_CONNTRACK_STATE_UNTRACKED; |
@@ -108,6 +108,7 @@ conntrack_mt(const struct sk_buff *skb, const struct net_device *in, | |||
108 | return false; | 108 | return false; |
109 | } | 109 | } |
110 | return true; | 110 | return true; |
111 | #undef FWINV | ||
111 | } | 112 | } |
112 | 113 | ||
113 | static bool | 114 | static bool |
diff --git a/net/netfilter/xt_policy.c b/net/netfilter/xt_policy.c index 5a017b8b72d0..46ee7e81a7af 100644 --- a/net/netfilter/xt_policy.c +++ b/net/netfilter/xt_policy.c | |||
@@ -38,7 +38,7 @@ match_xfrm_state(const struct xfrm_state *x, const struct xt_policy_elem *e, | |||
38 | unsigned short family) | 38 | unsigned short family) |
39 | { | 39 | { |
40 | #define MATCH_ADDR(x,y,z) (!e->match.x || \ | 40 | #define MATCH_ADDR(x,y,z) (!e->match.x || \ |
41 | (xt_addr_cmp(&e->x, &e->y, z, family) \ | 41 | (xt_addr_cmp(&e->x, &e->y, (z), family) \ |
42 | ^ e->invert.x)) | 42 | ^ e->invert.x)) |
43 | #define MATCH(x,y) (!e->match.x || ((e->x == (y)) ^ e->invert.x)) | 43 | #define MATCH(x,y) (!e->match.x || ((e->x == (y)) ^ e->invert.x)) |
44 | 44 | ||
diff --git a/net/netfilter/xt_string.c b/net/netfilter/xt_string.c index 902878444899..aff7a1160559 100644 --- a/net/netfilter/xt_string.c +++ b/net/netfilter/xt_string.c | |||
@@ -37,7 +37,7 @@ string_mt(const struct sk_buff *skb, const struct net_device *in, | |||
37 | != UINT_MAX) ^ conf->invert; | 37 | != UINT_MAX) ^ conf->invert; |
38 | } | 38 | } |
39 | 39 | ||
40 | #define STRING_TEXT_PRIV(m) ((struct xt_string_info *) m) | 40 | #define STRING_TEXT_PRIV(m) ((struct xt_string_info *)(m)) |
41 | 41 | ||
42 | static bool | 42 | static bool |
43 | string_mt_check(const char *tablename, const void *ip, | 43 | string_mt_check(const char *tablename, const void *ip, |